【发布时间】:2014-02-02 18:32:07
【问题描述】:
有没有办法在边框旁边的相对布局内布局视图。
我有以下布局(简化的测试用例),我想让图像尽可能向右移动,使其与右边框对齐。有没有什么布局方法可以做到这一点?
<RelativeLayout android:background="#ff0000"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<EditText android:layout_width='200dp'
android:layout_height='wrap_content'
android:text='First line'
android:id='@+id/first' />
<ImageView android:src='@drawable/test_grid16x16'
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_toRightOf ='@id/first'/>
</RelativeLayout>
【问题讨论】:
-
fill_parent 已弃用,请改用 match_parent。
-
fill_parent 不已弃用。
标签: android layout view android-relativelayout