我们如何在Android中进行内联布局?
像这样的东西:
我尝试在相对布局中使用边距,但它们被分成2列而不是相互包裹:
<RelativeLayout
android:id="@+id/Container"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:id="@+id/Layout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginRight="60sp">
.... //something here
</RelativeLayout>
<RelativeLayout
android:id="@+id/Layout2"
android:layout_width="60sp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true">
.... //something here
</RelativeLayout>
</RelativeLayout>
Layout2的宽度为60dp,在layout1中,你将边距设置为60dp,这样它们看起来像一个两列如果要检查它,将layout1的边距更改为30dp,你会看到包装效果,并在布局中放置一些控件,这样你就可以看到该地区