android控件属性

以你之姓@ 2022-07-24 05:03 427阅读 0赞

TextView控件常用属性:

android:id——控件的id

android:layout_width——控件的宽度(wrap_content:包裹实际文本内容 match_content:当前控件铺满父类容器(2.3api之后添加的一个属性值) fill_content:当前控件铺满父类容器(2.3api之前添加的一个控件属性))

android:layout_height——空间的高度

android:text——文本内容

android:textSize——文本大小(单位sp)

android:textColor——文本颜色

android:background——控件背景

EditText控件常用属性:

android:id——控件的id

android:layout_width——控件的宽度

android:layout_height——空间的高度

android:text——文本内容

android:textSize——文本大小

android:textColor——文本颜色

android:background——控件背景

android:hint——输入提示文本

android:inputType——输入文本类型

ImageView的常用属性:

android:src”@drawable/ic_launcher”——ImageView的内容图像

android:background”@drawable/ic_launcher”——ImageView的背景图像

android:background”@drawable/ic_launcher”——ImageViewdeRGB颜色

Button控件属性:

android:id“@+id/button1”——控件的id

android:layout_width——控件的宽度

android:layout_height——空间的高度

android:text——文本内容

ImageButton控件属性:

android:id“@+id/imageButton1”——控件的id

android:layout_width——控件的宽度

android:layout_height——空间的高度

android:src——背景

AutoCompleteTextView:

android:completionThreshold=”2” ——-输入多少字符时自动匹配

MultiAutoCompleteTextView控件属性:

可设置分隔符

ToggleButton控件属性:

ToggleButton有两种属性:选中和未选中状态,并且需要为不同的状态设置不同的显示文本。

abdroid:checked”true”——判断是否被选中

android:textOff”关”

android:textOn”开”

CheckBox控件属性:

android:checked”false”——判断是否被选中

RadioGroup控件属性:

android:orientation”vertiacl/horizontal”——决定RadioButton以什么形式排布

提供多选一机制

发表评论

表情:
评论列表 (有 0 条评论,427人围观)

还没有评论,来说两句吧...

相关阅读