<?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
में पैडिंग सेट करता हूं तो यह भी काम नहीं करता है। यहां क्या समस्या है? क्या आप मुझे कोई समाधान दे सकते हैं?क्यों मार्जिनबॉटम काम नहीं कर रहा है?
'fill_parent' को एपीआई लेवल 8 में शुरू किया गया है और 'match_parent' द्वारा प्रतिस्थापित किया गया है। –
@RosePerrone हाँ मुझे पता है, लेकिन मुझे लगता है कि यह उत्तर 2 साल पहले पोस्ट किया गया है;) –
बस अपना उत्तर अपडेट करें –