2012-01-05 16 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>