【发布时间】:2021-05-27 02:22:13
【问题描述】:
我想要的是让'6.4 MB' TextView 和'···'TextView 之间的'edit' ImageView,并让'edit' ImageView 接近'···'TextView。
<RelativeLayout
android:layout_width="fill_parent"
android:layout_marginTop="15dp"
android:layout_height="match_parent">
<ImageView
android:src="@drawable/screenshot"
android:layout_width="80dp"
android:layout_height="80dp"
android:id="@+id/screenShot"
android:layout_alignParentLeft="true"
android:layout_marginRight="10dp"
/>
<TextView
android:text="Video Name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="0dp"
android:textSize="23dp"
android:textColor="#000000"
android:id="@+id/videoName"
android:layout_toRightOf="@id/screenShot"
android:layout_alignParentTop="true"
/>
<TextView
android:text="2021.05.19 · 5:11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="0dp"
android:textSize="15dp"
android:textColor="#797675"
android:id="@+id/recordDate"
android:layout_toRightOf="@id/screenShot"
android:layout_below="@id/videoName"
/>
<TextView
android:text="6.4 MB"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="0dp"
android:textSize="15dp"
android:textColor="#797675"
android:id="@+id/videoSize"
android:layout_toRightOf="@id/screenShot"
android:layout_alignBottom="@id/screenShot"
/>
<ImageView
android:src="@drawable/edit"
android:layout_width="27dp"
android:layout_height="27dp"
android:id="@+id/edit"
android:layout_toRightOf="@id/videoSize"
android:layout_toLeftOf="@id/edit"
android:layout_alignBottom="@id/screenShot"
/>
<TextView
android:text="···"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="0dp"
android:textSize="40dp"
android:textColor="#000000"
android:id="@+id/moreAction"
android:layout_alignBottom="@id/screenShot"
android:layout_alignParentRight="true"
/>
</RelativeLayout>
如果我在 'edit' ImageView 中使用 android:layout_marginLeft="40dp",那么 'edit' ImageView 将消失。
为什么 android:layout_marginLeft 注意到工作?
有人可以帮忙吗?
【问题讨论】:
标签: android-layout android-relativelayout