android学习之textView布局文件

1.   layout_weight----------->控件占整个父布局的比重

 

 

	android:orientation="vertical" android:layout_width="fill_parent"
	android:layout_height="fill_parent">
	<TextView
		android:text="Button"
		android:id="@+id/button1" android:layout_width="fill_parent"
		android:layout_weight= "2"
		android:layout_height="wrap_content"></TextView>
	<TextView android:text="Button" android:id="@+id/button2"
	android:layout_weight= "3"
		android:layout_width="fill_parent" android:layout_height="wrap_content"></TextView>
</LinearLayout>

 效果:

 

android学习之textView布局文件

 

 

 

2.android:gravity="center_horizontal"-------》gravity指代的是控件中的内容的布局

 

3.android:padding="10px"------>父容器的边距

你可能感兴趣的:(android)