2012-01-05 46 views
0

我在這裏有兩個圖像瀏覽框架佈局。我如何使用第二個imageview,即+ id/CompositeImageViewTextj選擇寬度作爲fillparent,並同時使用第一個imageview'id/CompositeImageViewj'。在框架佈局中使用兩個圖像瀏覽

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent"  android:id="@+id/framel"> 

<Button 
    android:id="@+id/ChoosePictureButton1j" 
    android:layout_width="fill_parent" 
    android:layout_height="60dp" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentTop="true" 
    android:background="@drawable/color" 
    android:text="CHOOSE PICTURE" > 
</Button> 
<ImageView android:layout_width="fill_parent"android:layout_height="wrap_content"  android:id="@+id/CompositeImageViewj" android:paddingTop="100dip"></ImageView> 

<ImageView android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/CompositeImageViewTextj" android:paddingTop="100dip"></ImageView> 

<EditText 
    android:id="@+id/edtextj" 
    android:layout_width="172dp" 
    android:layout_height="62dp" 
    android:layout_gravity="bottom" 
    android:hint="Enter Caption" > 

<Button 
     android:id="@+id/okj" 
     android:layout_width="63dp" 
     android:layout_height="56dp" 
     android:layout_gravity="bottom" 
     android:layout_marginBottom=" 5dip" 
     android:layout_marginLeft=" 175dip" 
     android:background="@drawable/tick" /> 

    <Button 
     android:id="@+id/savej" 
     android:layout_width="match_parent" 
     android:layout_height="62dp" 
     android:layout_gravity="bottom" 
     android:layout_marginLeft=" 235dip" 
     android:text="SAVE" /> 

+1

你的問題很混亂。他們都在同一時間使用。只是一個不可見......我們需要澄清。你想要什麼?你有什麼?這將使我們以更好的方式幫助你。 – 2012-01-05 22:57:43

回答

0

你想使用的LinearLayout?你正在嘗試使用android:orientation =「vertical」 - 當然在FrameLayout中不存在。

1

我想你想同時在同一地點的圖像。

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/framel" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    > 

    <Button 
     android:id="@+id/ChoosePictureButton1j" 
     android:layout_width="match_parent" 
     android:layout_height="60dp" 
     android:background="#d3d3d3" 
     android:text="CHOOSE PICTURE" 
     > 
    </Button> 

    <ImageView 
     android:id="@+id/CompositeImageViewj" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:background="@drawable/truck" 
     android:layout_marginTop="50dp" 
     > 
    </ImageView> 

    <ImageView 
     android:id="@+id/CompositeImageViewTextj" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:background="@drawable/ic_launcher" 
     android:layout_marginTop="50dp" 
     > 
    </ImageView> 

    <EditText 
     android:id="@+id/edtextj" 
     android:layout_width="172dp" 
     android:layout_height="62dp" 
     android:layout_gravity="bottom" 
     android:hint="Enter Caption" /> 

     <Button 
      android:id="@+id/okj" 
      android:layout_width="63dp" 
      android:layout_height="56dp" 
      android:layout_gravity="bottom" 
      android:layout_marginBottom=" 5dip" 
      android:layout_marginLeft=" 175dip" 
      android:background="@drawable/truck" /> 

     <Button 
      android:id="@+id/savej" 
      android:layout_width="match_parent" 
      android:layout_height="62dp" 
      android:layout_gravity="bottom" 
      android:layout_marginLeft=" 235dip" 
      android:text="SAVE" /> 
</FrameLayout>