Android中的基本控件(上)--按钮控件Button
2014-04-07 21:03
302 查看
Button类的继承结构:
java.lang.Object
↳ android.view.View
↳android.widget.TextView
↳android.widget.Button
所有组件垂直摆放
布局管理器宽度为屏幕宽度
布局管理器高度为屏幕高度
定义组件按钮的id,为Activity程序使用
宽度为文字的宽度
高度为文字的高度
文字的颜色RGB码
设置文字大小
设置文本
java.lang.Object
↳ android.view.View
↳android.widget.TextView
↳android.widget.Button
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <Button android:id = "@+id/mybut1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#FF0000" android:textSize="12px" android:text="按钮组件" /> </RelativeLayout>
所有组件垂直摆放
布局管理器宽度为屏幕宽度
布局管理器高度为屏幕高度
定义组件按钮的id,为Activity程序使用
宽度为文字的宽度
高度为文字的高度
文字的颜色RGB码
设置文字大小
设置文本
相关文章推荐
- Android OpenGL ES顶点坐标、纹理贴图坐标设置
- 从零开始学android<CheckBox多选按钮的使用.八.>
- Genymotion - 强大好用高性能的 Android 模拟器 (在电脑流畅运行APK安卓软件游戏的利器)
- Android之TextView实现文字过长时省略部分或者滚动显示
- Android之TextView实现文字过长时省略部分或者滚动显示
- android应用开发——android存储之SharedPreferences
- android之expandableListView+BaseExpandableListAdapter+ArrayList伸缩的用法:
- 笔记14--android中Shape、Selector
- Android学习笔记(1)
- android之surfaceView
- winxp下j2me环境,android,nokiaSdk的配置
- android 点击事件 按钮事件
- android Widget 桌面小图标,类似快捷方式
- Android实战--实现读取通讯录和拨打电话功能
- Android Intent调用大全
- android TrafficStates 获取手机流量使用情况
- android Toast 自定义消息显示
- [置顶] Android SQLiteDatabase 数据库操作(建立数据表,增删改查操作)
- android短信备份与还原
- android SlidingDrawer伸缩折叠布局组件