Button属性

Button 类的层次关系如下:

java.lang.Object
   ↳ android.view.View
       ↳ android.widget.TextView
            ↳android.widget.Button

直接子类:

CompoundButton

间接子类:

CheckBox, RadioButton, ToggleButton

类方法

前面为方法,中间为解释,后面为方法的返回值

onKeyDown //当用户按键时,该方法调用 //Boolean

onKeyUp //当用户按键弹起后,该方法被调用 //Boolean

onKeyLongPress //当用户保持按键时,该方法被调用 //Boolean

onKeyMultiple //当用户多次调用时,该方法被调用 //Boolean

invalidateDrawable //刷新Drawable 对象 //void

scheduleDrawable //定义动画方案的下一帧 //void

unscheduleDrawable //取消scheduleDrawable 定义的动画方案 //void

onPreDraw //设置视图显示,列如在视图显示之前调整滚动轴的边界 //Boolean

sendAccessibilityEvent //发送事件类型指定的AccessibilityEvent。发送请求之前,需要检查Accessibility是否打开  //void

sendAccessibilityEventUnchecked //发送事件类型指定的

AccessibilityEvent。发送请求之前,不需要检查Accessibility是否打开 //void

setOnKeyListener //设置按键监听 //void

属性

android:layout_height //设置控件高度。可选值:fill_parent,warp_content,px

android:layout_width //设置控件宽度,可选值:fill_parent,warp_content,px
android:text //设置控件名称,可以是任意字符

android:layout_gravity //设置控件在布局中的位置,可选项:top,left,bottom,right,center_vertical,fill_vertica,fill_horizonal,center,fill 等

android:layout_weight //设置控件在布局中的比重,可选值:任意的数字

android:textColor //设置文字的颜色

android:bufferType //设置取得的文本类别,normal、spannable、editable

android:hint //设置文本为空是所显示的字符

android:textColorHighlight //设置文本被选中时,高亮显示的颜色

android:inputType //设置文本的类型,none,text,textWords 等
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值