1:在布局中,可以设置layout_below,方便界面布局。
ps:如果设置的布局中below敲完没有出选项,那就是该布局不支持。
2:fitxy的使用方法,这个用法一般是将图片大小调到铺满屏幕,不留白。比如:
3:使用文本框居中的方法:设置layout_gravity=“bottom|center_horizontal”
layoit_Bottom=“35dp”,这样就好了。hravity应用于任何布局,below只能在相关布局中用。
5.比较几句语句的特点: android:layout_gravity=“center_horizontal”
android:layout_centerVertical=“true” android:layout_centerHorizontal=“true”
6.几个好用的组件:,,,用法很简单,checkbox框框打勾的那种。group和button两个要结合起来用。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<CheckBox
android:id="@+ideckBox2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checked="true"
android:text="打牌" />
<CheckBox
android:id="@+ideckBox3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="溜冰" />
<CheckBox
android:id="@+ideckBox4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="读书" />
<CheckBox
android:id="@+ideckBox5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="旅行" />
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RadioButton
android:id="@+id/radioButton2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checked="true"
android:text="男" />
<RadioButton
android:id="@+id/radioButton3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="女" />
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RadioButton
android:id="@+id/radioButton4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checked="true"
android:text="晴天" />
<RadioButton
android:id="@+id/radioButton5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="雨天" />
<Button
android:id="@+id^tton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button" />
</RadioGroup>
</RadioGroup>
</LinearLayout>
运行效果
7:Tablelayout的使用,其实就是一个框框,里面可以自己加东西。table本身就是表格的意思,这个很好理解。