You cannot combine custom titles with other title features
来源:互联网 发布:怎么看淘宝旗舰店执照 编辑:程序博客网 时间:2024/05/17 05:16
使用下面代码自定义标题栏:
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);//自定义标题栏
setContentView(R.layout.main_tijian);
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);//自定义标题栏
setContentView(R.layout.main_tijian);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title);
在2.3的Android系统上可以运行,在4.0的系统上报如标题所示的错,原因是4.0默认了添一个加标题栏,解决办法:
程序初始为:
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
将 android:theme="@style/AppTheme"
修改为 android:theme="@android:style/Theme.Dialog"
另一种方法为通过actionBar来设置(R.layout.title_bar为自己建立的布局xml文件(也可是自定义的View对象)):
ActionBar actionBar = this.getActionBar();
actionBar.setCustomView(R.layout.title_bar);
actionBar.setDisplayShowCustomEnabled(true);
actionBar.setDisplayShowHomeEnabled(false);
actionBar.show();
0 0
- You cannot combine custom titles with other title features
- You cannot combine custom titles with other title features
- You cannot combine custom titles with other title features
- You cannot combine custom titles with other title features
- You cannot combine custom titles with other title features
- You cannot combine custom titles with other title features
- You cannot combine custom titles with other title features
- You cannot combine custom titles with other title features
- android自定义title出现 You cannot combine custom titles with other title features
- Android4.0上 : 关于you cannot combine custom titles with other title features 错误
- 报错android.util.AndroidRuntimeException: You cannot combine custom titles with other title features
- [Bug 笔记]You cannot combine custom titles with other title features
- android.util.AndroidRuntimeException: You cannot combine custom titles with other title features
- android.util.AndroidRuntimeException: You cannot combine custom titles with other title features .
- android.util.AndroidRuntimeException: You cannot combine custom titles with other title features .
- android.util.AndroidRuntimeException: You cannot combine custom titles with other title features
- android.util.AndroidRuntimeException: You cannot combine custom titles with other title features
- 关于报错You cannot combine custom titles with other title features
- 题目1003:A+B
- Android获取存储卡路径的方式
- error BK1506
- 译作:《50 Android Hacks》中文版:《打造高质量Android应用:Android开发必知的50个诀窍》
- Handler sendMessage 与 obtainMessage (sendToTarget)比较
- You cannot combine custom titles with other title features
- 快排
- Winform捕获全局异常
- jQuery实现列表自动循环滚动鼠标悬停时停止滚动
- 对随机梯度下降的一些使用心得
- 【PyQt4实例7】QPainter坐标系的变换【转载】
- jq 使用手册
- 卓有成效的敏捷开发流程
- 高级语法-省略