почему не работает marginBottom?

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/messageLayout"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">

    <ImageView
        android:id="@+id/messageSender"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginRight="10dp"
        android:layout_marginLeft="10dp"
        android:layout_marginTop="5dp"
        android:layout_marginBottom="5dp"/>

    <TextView
        android:id="@+id/messageSenderName"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/messageSender"
        android:ellipsize="end"
        android:maxLines="1"
        android:singleLine="false"
        android:textColor="@color/list_text_color"
        android:textSize="16dp"
        android:layout_marginTop="5dp" />

    <TextView
        android:id="@+id/messageContent"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/messageSender"
        android:layout_below="@id/messageSenderName"
        android:ellipsize="end"
        android:maxLines="1"
        android:singleLine="false"
        android:textColor="@color/codeFont"
        android:textSize="13dp"/>
</RelativeLayout>

В моем макете У меня проблемы. Когда я устанавливаю marginTop = "5dp" , это нормально, но когда я использую marginBottom , в моем макете ничего не происходит. Также, когда я устанавливаю отступы в RelativeLayout , это тоже не работает. В чем проблема? Не могли бы вы дать мне какое-нибудь решение?

41
задан Bugs Happen 12 October 2015 в 05:34
поделиться