您的位置:首页 > 移动开发 > Android开发

Android中的基本控件(上)--按钮控件Button

2014-04-07 21:03 302 查看
Button类的继承结构:

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码

设置文字大小

设置文本

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: