android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
解释上面代码的意思:
标签:定义了整个程序显示的布局。
在LinearLayout布局中,android:orientation用于定义布局中子元素的排列方式,布局包含两种排列方式:vertical(垂直排列)和horizontal(水平排列)。
android:layout_width 定义了元素布局的宽度,可以通过三种方式来指定宽度。
1)fill_parent:宽度和父元素相同;
2)wrap_content:宽度随组件本身的内容调整;
3):通过指定px值来设置宽度。
android:layout_height 定义了元素布局的高度,可以通过三种方式来指定高度。
1)fill_parent:宽度和父元素相同;
2)wrap_content:宽度随组件本身的内容调整;
3):通过指定px值来设置宽度。