嵌套的相对和线性布局

时间:2012-02-19 23:19:33

标签: android android-layout

我是android中的布局新手,想要实现如下所示的布局,但是我对如何用XML格式化布局感到困惑。

enter image description here

我目前正在尝试:

<LinearLayout>
     <RelativeLayout>
         <ImageView>
         <TextView>
     </RelativeLayout>
     <LinearLayout>
         <ImageView>
         <TextView>
         <ImageView>
         <TextView>
     </LinearLayout>
</LinearLayout>

我不想让我的布局结构复杂化。是否有更好的方法来构建它?

1 个答案:

答案 0 :(得分:0)

最好看一下这个链接。根据经验,不要尝试过多地嵌套布局,即尽可能保持浅。

因此,在这种情况下,相对布局通常会更好。

http://developer.android.com/resources/articles/layout-tricks-efficiency.html

相关问题