重点
1.Android有几大布局
2.Android的基础控件,常用属性有什么
内容
Android有五大布局分别是
LinearLayout (线性布局) RelativeLayout(相对布局)
TableLayout (表格布局) FrameLayout (帧布局)
ConstraintLayout(约束布局)
Android的基础控件
TextView 常用属性:
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="15dp"
android:textColor="@color/purple_500"
android:text="文本框控件"/>
EditView 常用属性:
<EditText
android:id="@+id/edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:hint="输入文本框控件"/>
ImageView 常用属性:
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/a4"
android:scaleType="fitXY"/>
Button 常用属性:
<Button
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:stateListAnimator="@color/purple_500"
android:text="按钮控件"/>
RadioGroup 常用属性
<RadioGroup
android:id="@+id/radio"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:text="好"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:text="不好"/>
</RadioGroup>
CheckBox 复选
<CheckBox
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="苹果"/>
<CheckBox
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="葡萄"/>
<CheckBox
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="桃子"/>
<CheckBox
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="橘子"/>