码迷,mamicode.com
首页 > 其他好文 > 详细

Activity常用的方法

时间:2017-05-16 20:08:47      阅读:218      评论:0      收藏:0      [点我收藏+]

标签:--   cti   resid   tostring   textview   als   find   false   获取   


1. View findViewById(int id) //根据组件ID取得组件对象
setContentView(int LayoutResID) //设置布局文件,设置显示组件

2. TextView
android:maxLength="6" //允许最大字符数
android:textColor="#FF0000" //文字的颜色
android:textSize="50px" //文字的大小
android:textStyle="bold" //文字样式
android:password="true" //是否以密方式显示
android:layout-margin="100px" //外边距
android:background="@drawable/a" //背景
android:id="@+id/id值" //设置id的值

getText() .tostring() //获取空间文本内容
setText() ; // 设置空间文本内容

注意<!---->: 注释
3. Button
4.EditText
android:enabled="false" //设置 是否可用,false不可用

Activity常用的方法

标签:--   cti   resid   tostring   textview   als   find   false   获取   

原文地址:http://www.cnblogs.com/alhy/p/6863146.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!