我已经创建了使用线性布局的下面的布局,它的运行良好,但我有一个疑问,它可以优化,因为我已经使用嵌套的线性布局创建此UI,我认为它不好。Android - 想优化布局
所以,你能帮我通过使用相对布局或其他方式来优化这种线性布局吗?
我已经等被定义的布局:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="6dip">
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_weight="1"
android:layout_height="fill_parent"
android:layout_marginLeft="10dip">
<TextView
android:id="@+id/txtViewTitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:textSize="18dip"
android:text="hello"
/>
<TextView
android:id="@+id/txtViewDescription"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:textSize="14dip"
android:text="hello"
/>
</LinearLayout>
<ImageView
android:id="@+id/image"
android:layout_width="50dip"
android:layout_height="fill_parent"
android:src="@drawable/arrow"
android:layout_marginLeft="3dip"
android:scaleType="center"/>
</LinearLayout>
@PM:你能否详细解释你的问题,我的意思是你想做什么? –
解释您的预期设计,如果可能请附上图片。 –
@Tushar我不想改变设计,但想要优化上面的代码,因为我采取了嵌套的线性布局。 –