Android开发随记(3)-- ActionBar控件显示、Checkbox样式
2015-04-08 10:18
141 查看
1.ActionBar上面添加返回键按钮
*
显示
Appicon
左侧的
back
键
*/
ActionBaractionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
@Override
public boolean onOptionsItemSelected(MenuItemitem) {
switch (item.getItemId()){
case android.R.id.home:
this.finish();
default:
return super.onOptionsItemSelected(item);
}
}
getActionBar().setDisplayShowTitleEnabled(false); //不显示标题
getActionBar().setDisplayHomeAsUpEnabled(false);//左侧箭头是否显示
getActionBar().setDisplayShowHomeEnabled(false);//左侧图标是否显示
2.
自定义
checkbox样式
<?xmlversion="1.0"encoding="utf-8"?>
<selectorxmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/check_true" android:state_checked="true"></item>
<item android:drawable="@drawable/check_true" android:state_selected="true"></item>
<item android:drawable="@drawable/check_true" android:state_pressed="true"></item>
<item android:drawable="@drawable/check_false"></item>
</selector>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_check"
android:button="@null"
android:checked="true"/>
注:android:button="@null"不能少,否则会没有效果
相关文章推荐
- JQuery Highcharts图表控件多样式显示多组数据
- 为什么CheckBox只能控制Panel控件的显示,不能控制它的隐藏呢?
- 让Webbrowser、CDHtmlDialog中的控件显示为系统主题样式
- 设置控件全局显示样式appearance proxy
- WPF中Expander控件样式,ListBox的样式(带checkbox)恢复
- Android 自定义Checkbox显示样式
- Vistual studio 中在设计时显示控件的XP样式
- IOS 应用/游戏项目应该如何灵活封装 控件显示样式与项目颜色的公用
- 服务端控件在客户端显示的最终样式
- JQuery Highcharts图表控件多样式显示多组数据
- 使用DataList分页显示数据,双向排序,添加checkbox控件。
- vs2003树控件 显示两层树菜单和树样式表
- Flex中利用Repeater显示一组CheckBox控件的例子
- 设置控件全局显示样式appearance proxy
- JQuery Highcharts图表控件多样式显示多组数据
- Flex中如何通过errorString属性在CheckBox控件上设置一个错误信息显示字符串的例子
- 关于 VS2008 字符集改用多字节字符集时,控件显示样式变为旧样式的问题的解决
- ListView-更改控件显示样式
- Android 常用控件自定义样式RadioButton、CheckBox、ProgressBar、
- YII中用jquery修改CheckBoxList的显示样式