基本组件API

标签:TextView

TextView的创建:代码中new TextView;在XML配置,还可使用if

相关属性:android:text android:textColor android:testStyle android:textface

ButtonTextView的子类

实现按钮监听方法:

1)在Activity上定义某个方法,接受按钮作为View参数,返回void,而且带public 修饰符。

2)在XML布局文件的Button中,添加android:onCLick特性,该特性的值为上步说的某个方法

图像部件:ImageViewImageButton ImageButtonImageView的子类

android:src指定要添加的图像

图像在Android中叫做可绘制资源

也可以使用setImageURI()方法基于ContentProvider实现

字段部件:EditText TextView的子类

属性:andorid:autotext andorid:capitalize andorid:digits andorid:singleLine(false:可键入多行)

复选框:CheckBox textView的子类

方法:isChecked() setChecked() toggle()

监听器:onCheckedChangeListener

单选按钮RadioButton

方法:isChecked() setChecked() toggle()

一般将RadioButton放于RadioGroup中,常用方法:

Check() clearCheck() getCheckedRadioButtonId()

视图View

常用属性:andorid:nextFocusDown andorid:nextFocusLeft

andorid:nextFocusRight andorid:nextFocusUp

andorid:visibility

方法:setEnabled():启用或停用组件 isEnabled()判断~

GetParent() fineViewById() getRootView()

颜色ColorStateList

改变TextView颜色方法:

1ColorStateList.valueof()

2)在XML中配置

更多相关文章

  1. Android窗口机制(二)Window,PhoneWindow,DecorView,setContentView源
  2. Android的IPC机制
  3. andorid 记录,以后看
  4. android 设置Button或者ImageButton的背景透明
  5. Android窗口机制(三)Window和WindowManager的创建与Activity
  6. android单选按钮RadioGroup的详细使用
  7. Android中drawable各个属性讲解
  8. Android深入四大组件(一)应用程序启动过程
  9. Android中drawable各个属性讲解

随机推荐

  1. Android中cpu,memory,Battery的计算
  2. Android(安卓)4.0 ,gradle 4.0.0 butterk
  3. Android(安卓)SlidingMenu 使用详解
  4. Android(安卓)Fresco图片处理库用法API英
  5. Android(安卓)开 发 资 源 分 享
  6. android中如何给button加圆角
  7. android 调节媒体音量
  8. android 常用模块
  9. Android随意拖动控件
  10. 调用Android发短信接口Intent.ACTION_SEN