一:
LinearLayout
RelativeLayout
二:
ListView
GridView
例子:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<TextView
android:id="@+id/textview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="the first textview"/>
<TextView
android:id="@+id/textview2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="the second textview"/>
</LinearLayout>
注意此时第二个控件就被挤出屏幕外了
px/dpi/dp/ps 概念
px 像素
dpi 每英寸含像素个数
dip(dp)与设备无关像素
sp
控件内容与控件边缘的边距叫内边距
控件边缘与其他控件的距离叫外边距