android组件

来源:互联网 发布:yy淘宝刷单兼职靠谱吗 编辑:程序博客网 时间:2024/05/16 08:16

TextView中autoLink显示的格式
background背景,可以是图片,或者是一种格式(drawable)
textColor 文本颜色
solid 固体,固态的;
stroke

button
item 一项 ;
state_pressed状态;
ToggleButton 切换按钮(状态);
ImageButton  应用图片;


redioButton(单选按钮)
RadioGroup和RadioButton(单选框),
RadioGroup用于对单选框进行分组,相同组内的单选框只有一个单选框能被选中。
RadioGroup.check(R.id.dotNet);将id名为dotNet的单选框设置成选中状态。
(RadioButton) findViewById(radioGroup.getCheckedRadioButtonId());//获取被选中的单选框。(强转)
findViewById(radioGroup.setCheckedRadioButtonId());//设置被选中的单选框。

RadioButton.getText();//获取单选框的值
调用setOnCheckedChangeListener()方法,处理单选框被选择事件,把RadioGroup.OnCheckedChangeListener实例作为参数传入

CheckBox(复选)
每个多选框都是独立的,可以通过迭代所有多选框,然后根据其状态是否被选中再获取其值。
 CheckBox.setChecked(true);//设置成选中状态。isChecked()
 CheckBox.getText();//获取多选框的值
 调用
定义一个字符串 用于显示;setOnCheckedChangeListener()方法,处理多选框被选择事件,把CompoundButton.OnCheckedChangeListener实例作为参数传入