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

基本控件的使用

时间:2017-05-16 23:26:36      阅读:249      评论:0      收藏:0      [点我收藏+]

标签:style   对象   ack   find   div   文件颜色   log   lin   最大   

1.Activity的常用方法
  View findViewById(int id)         //根据组件的ID取得组件对象
  setContentView(int layoutResID)     //设置布局文件,设置显示组件


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

  getText().toString()           //获得控件的文本内容
  setText();                //设置控件的文本内容


3.EditText
android:enabled = "false"         //设置是否可用,false不能用

注意:<!--xx-->注释

基本控件的使用

标签:style   对象   ack   find   div   文件颜色   log   lin   最大   

原文地址:http://www.cnblogs.com/dahaoheshan/p/6863738.html

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