1

button画像の上にがlinearlayoutあります。画像は正常に表示されていますが、linearlayout上の画像が表示されません。

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#E9E0DB" >

    <LinearLayout
        android:id="@+id/editdialogstartedlayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@+id/profdialogphotoimageview"
        android:background="#ffffff"
        android:orientation="horizontal"
        android:padding="5dip" >

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="right"
            android:text="Edit"
            android:textColor="#000000" />
    </LinearLayout>

    <com.example.masonrytest.views.ScaleImageView
        android:id="@+id/profdialogphotoimageview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" />

    <LinearLayout
        android:id="@+id/textlayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/profdialogphotoimageview"
        android:background="#ffffff"
        android:orientation="vertical"
        android:padding="5dip" >

        <TextView
            android:id="@+id/text1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@id/profdialogphotoimageview"
            android:text="There Is Nothing Negative In Total Exploitation Of Natural Resources. What Say?"
            android:textColor="#000000"
            android:textSize="12dp"
            android:textStyle="normal" />

        <LinearLayout
            android:id="@+id/dialog_details"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:padding="5dip" >

            <ImageView
                android:id="@+id/list_image"
                android:layout_width="30dp"
                android:layout_height="30dp"
                android:layout_alignBottom="@id/text1"
                android:src="@drawable/picture1" />

            <TextView
                android:id="@+id/title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignTop="@+id/list_image"
                android:layout_toRightOf="@+id/list_image"
                android:padding="5dip"
                android:text="By Andrew"
                android:textColor="#000000"
                android:textSize="10dp"
                android:textStyle="normal" />

            <ImageView
                android:id="@+id/list_image"
                android:layout_width="20dp"
                android:layout_height="20dp"
                android:layout_alignParentRight="true"
                android:layout_marginLeft="25dp"
                android:src="@drawable/member" />

            <TextView
                android:id="@+id/title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:padding="5dip"
                android:text="8"
                android:textColor="#000000"
                android:textSize="10dp"
                android:textStyle="normal" />

            <ImageView
                android:id="@+id/list_image"
                android:layout_width="20dp"
                android:layout_height="20dp"
                android:layout_alignParentRight="true"
                android:layout_marginLeft="10dp"
                android:src="@drawable/udebate_fav" />

            <TextView
                android:id="@+id/title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:padding="5dp"
                android:text="64"
                android:textColor="#000000"
                android:textSize="10dp" />
        </LinearLayout>
    </LinearLayout>

</RelativeLayout>

アイデアや提案はありますか?

ありがとう。

4

5 に答える 5

2

それを試してみてください。

LinearLayout から次のプロパティを削除します。

 android:layout_above="@+id/profdialogphotoimageview"

そして、置きます

 android:layout_alignParentTop="true"

また、「 com.example.masonrytest.views.ScaleImageView」に次のプロパティを配置する必要があります

 android:layout_below="@+id/editdialogstartedlayout"

これで、必要な実際のビューを取得できます。古いコードでは、塗りつぶしの親の高さがあるため、ボタンが表示されないため、画面のすべてのサイズが必要です。このレイアウトの上にある LinearLayout が、画面の上に移動した理由です。

于 2013-07-10T13:57:32.093 に答える
0

要素com.example.masonrytest.views.ScaleImageViewに次の行を追加してみてください。

android:layout_toEndOf="@id/editdialogstartedlayout"
于 2013-07-10T12:41:36.273 に答える
0
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#E9E0DB" >

<LinearLayout
    android:id="@+id/editdialogstartedlayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="#ffffff"
    android:orientation="horizontal"
    android:padding="5dip"
    android:layout_alignParentTop="true" >

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="right"
        android:text="Edit"
        android:textColor="#000000" />
</LinearLayout>

<com.example.masonrytest.views.ScaleImageView
    android:id="@+id/profdialogphotoimageview"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/editdialogstartedlayout" />

<LinearLayout
    android:id="@+id/textlayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/profdialogphotoimageview"
    android:background="#ffffff"
    android:orientation="vertical"
    android:padding="5dip" >

    <TextView
        android:id="@+id/text1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="There Is Nothing Negative In Total Exploitation Of Natural Resources. What Say?"
        android:textColor="#000000"
        android:textSize="12dp"
        android:textStyle="normal" />

    <LinearLayout
        android:id="@+id/dialog_details"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:padding="5dip" >

        <ImageView
            android:id="@+id/list_image"
            android:layout_width="30dp"
            android:layout_height="30dp"
            android:layout_alignBottom="@id/text1"
            android:src="@drawable/picture1" />

        <TextView
            android:id="@+id/title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignTop="@+id/list_image"
            android:layout_toRightOf="@+id/list_image"
            android:padding="5dip"
            android:text="By Andrew"
            android:textColor="#000000"
            android:textSize="10dp"
            android:textStyle="normal" />

        <ImageView
            android:id="@+id/list_image"
            android:layout_width="20dp"
            android:layout_height="20dp"
            android:layout_alignParentRight="true"
            android:layout_marginLeft="25dp"
            android:src="@drawable/member" />

        <TextView
            android:id="@+id/title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:padding="5dip"
            android:text="8"
            android:textColor="#000000"
            android:textSize="10dp"
            android:textStyle="normal" />

        <ImageView
            android:id="@+id/list_image"
            android:layout_width="20dp"
            android:layout_height="20dp"
            android:layout_alignParentRight="true"
            android:layout_marginLeft="10dp"
            android:src="@drawable/udebate_fav" />

        <TextView
            android:id="@+id/title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:padding="5dp"
            android:text="64"
            android:textColor="#000000"
            android:textSize="10dp" />
    </LinearLayout>
</LinearLayout>

于 2013-07-10T12:13:07.123 に答える
0

ここでメイン レイアウトに ID を指定します

 RelativeLayout android:id="@+id/main"
そして追加
 android:layout_below="@+id/main" to  LinearLayout 
 

于 2013-07-10T12:21:46.530 に答える