笔记 - Android - 3.控件属性

Android:控件
    <TextView/>:普通文本标签
    
    <EditText/>:输入框
        > android:hint:在输入框控件中起提示作用;
        > android:lines:限定输入框的可视行数
        > android:maxLength:限定输入框中的可输入字符长度;
        > android:inputType:指定输入框的类型
            >> textPassword:指定输入框类型为密码框
            >> ......
        
        
    <Button/>:按钮
        > android:onClick:指定该按钮的单击事件方法名
        
    <CheckBox/>:复选框
        > android:checked:布尔值,指示复选框初始状态

··控件通用属性
    android:id:每个控件的唯一标识符;
    android:text:控件中显示的文本字符串;
    android:textColor:控件中显示的文字的颜色;
    android:textSize:控件中字体的大小,单位为sp;
    
··控件通用布局属性
    android:layout_width:控件的宽度
        取值:
            fill_parent:填充父容器
            match_parent:填充父容器,与fill_parent相同
            wrap_content:包裹内容,表示控件宽度随内容的宽度变化而变化
    android:layout_height:控件的高度
        取值:
            同宽度
    android:layout_above:该控件位置在指定控件的上面
    android:layout_below:该控件位置在指定控件的下面
    android:layout_toLeftOf:该控件位置在指定控件的左边
    android:layout_toRightOf:该控件位置在指定控件的右边
    
    android:layout_margin:上下左右四边外边距
    android:layout_marginTop:上外边距
    android:layout_marginRight:右外边距
    android:layout_marginBottom:下外边距
    android:layout_marginLeft:左外边距
    android:layout_padding:上下左右四边内边距
    android:layout_paddingTop:上内边距
    android:layout_paddingRight:右内边距
    android:layout_paddingBottom:下内边距
    android:layout_paddingLeft:左内边距
   
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值