首页 > 移动平台 > 详细

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

时间:2014-04-08 04:43:38      阅读:601      评论:0      收藏:0      [点我收藏+]

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码
设置文字大小
设置文本

bubuko.com,布布扣


Android中的基本控件(上)--按钮控件Button,布布扣,bubuko.com

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

原文:http://blog.csdn.net/waldmer/article/details/23127919

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!