Tôi có một RelativeLayout
cho một hàng nằm trong một ListView
. Hàng có vẻ như,lề dưới hoặc đệm không hoạt động trong bố cục tương đối trong xml trên android
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relativeLayout1"
android:layout_width="wrap_content"
android:layout_height="fill_parent">
<ImageView
android:id="@+id/placeDetailIcon_Img"
android:layout_height="50dp"
android:layout_width="50dp"
android:layout_alignParentLeft="true"
android:paddingBottom="20dp"
android:paddingTop="20dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"/>
</RelativeLayout>
Tôi cũng đã thử nó với margin:
<ImageView
android:layout_height="50dp"
android:layout_width="50dp"
android:id="@+id/placeDetailIcon_Img"
android:layout_alignParentLeft="true"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:layout_marginLeft="10dp"
android:layout_marginBottom="10dp">
Không áp dụng margin hoặc padding xung quanh ImageView
. Làm cách nào để tạo loại khoảng cách này?
RelativeLayout 'android: layout_height =" wrap_content "'? – zapl
Và cũng loại bỏ 'RelativeLayout' nếu các mục trong danh sách của bạn sẽ được biểu diễn bằng một khung nhìn. –