Android 中 Button 组件有以下一些常用属性:
1. text: 设置Button显示的文本内容。
2. textColor: 设置Button文本的颜色。
3. textSize: 设置Button文本的大小。
4. background: 设置Button的背景图片或颜色。
5. enabled: 决定Button是否可用。
6. onClick: 设置Button点击时的事件。
7. id: 设置Button的唯一标识符。
8. layout_width/layout_height: 设置Button的尺寸。
9. padding: 设置Button内边距。
10. gravity: 设置Button内文本的对齐方式。
11. maxLines: 设置Button最多显示的行数。
12. ellipsize: 设置Button超出部分的处理方式,如截断等。
13. style: 设置Button的样式,如颜色、形状等。
14. focusable/clickable: 设置Button是否可获得焦点和点击。
这些只是 Button 组件一些常用的属性,Android 提供了更多属性供开发者使用和自定义 Button 外观及行为。