自定义Titlebar时为了避免冲突

需要修改:AndroidManifest.xml

android:theme="@style/mystyle" 

styles.xml文件中需要加上下面内容

<style name="mystyle" parent="android:Theme">
<item name="android:windowTitleSize">50dp</item>
</style>
 
下面是网上别人的详细分析:
运行项目时,有时LogCat报错: AndroidRuntimeException: You cannot combine custom titles with other title feature

网上说,去掉AndroidManifest.xml中Activity的android:theme="@android:style/Theme.NoTitleBar.Fullscreen"属性。但我看AndroidManifest.xml 根本没有设这个值

[Java] 纯文本查看 复制代码
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
<application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/TitleBarStyle">
        <activity
            android:name="com.example.b.MainActivity"
            android:label="@string/app_name">
            <intent-filter>
                <action
android:name=
"android.intent.action.MAIN"/>
 
                <category
android:name=
"android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
    </application>

有可能是@style/AppTheme里面设了这个值吧?于是我再看values/styles.xml文件

4.0 即API 14,AppBaseTheme应该在values-v14/style.xml里面的

于是我再去看android:Theme.Holo.Light.DarkActionBar 

<style name="Theme.Holo.Light.DarkActionBar"> 里面没有关于类似<style name="windowNoTitle">的东西

<style name="Theme.Holo.Light">代码

太多东西了{:soso_e117:},他们引用的东西也不尽相同.....

解决方法:

后来,我直接在 AndroidManifest.xml 中,将android:theme="@style/AppTheme" 直接改成android:theme="@style/android:Theme.Light" (就是不继承API 14中的Theme,用回API 11前的Theme)

或者,删除values-v11和values-v14里面的styles.xml

 
让系统自动调用values/styles.xml

由于API-11的<style name="Theme.Holo.Light"> 和 API-14<style name="Theme.Holo.Light.DarkActionBar"> 跟API之前版本的<style name="Theme.Light"> 代码太多不同了,所以就我也不明白到底哪里出了问题

看到别人博客上还有一个解决的方案:

在style.xml中修改加入这句“ <item name="android:windowActionBar">false</item>”

  1. <style name="AppTheme" parent="AppBaseTheme">
  2. <!-- All customizations that are NOT specific to a particular API-level can go here. -->
  3. <item name="android:windowActionBar">false</item>
  4. </style>
 

转 Android 4.0后,自定义Title报错 You cannot combine custom titles with other title feature的更多相关文章

  1. android 自定义title 报错 You cannot combine custom titles with other title feat

    solution: http://www.apkbus.com/android-80416-1-1.html http://www.eoeandroid.com/forum.php?mod=viewt ...

  2. Android真机调试 Android.Util.AndroidRuntimeException: You cannot combine custom titles with other title features

    参考连接:http://blog.csdn.net/scyatcs/article/details/9003285 Android.Util.AndroidRuntimeException: You ...

  3. 解决Android Studio编译后安装apk报错:Error while Installing APK

    刚开始玩 Android ,用Android studio  连接真机做测试,在虚拟机上没有问题,但是真机就会报错 检查了好多地方,最终发现了问题,网上的常规就不介绍了,大家自己去看别的帖子 手机方面 ...

  4. 我的Android进阶之旅------>解决Android Studio编译后安装apk报错:The APK file does not exist on disk

    1.错误描述 今天用Android Studio编译应用后安装APK的时候,报错了,错误如下所示: The APK file build\outputs\apk\OYP_2.3.4_I2Base_64 ...

  5. 创建好Android Application Project 后运行就报错。

    如图: 这个问题有可能是有可能是没导入Android support库,简单了解一下: google提供了Android Support Library package 系列的包来保证来高版本sdk开 ...

  6. appium在android 7.0真机上运行报错command failed shell:............ps:'uiautomator"的解决方式

    appium版本:1_4_16 在CSDN中找到相关解决的方案,根据此解决方案顺利的解决了让人惆怅的问题,再次记录. 1.找到appium安装目录下的adb.js文件,目录为:Appium\node_ ...

  7. RN与android原生开发混合后的环境报错问题

    RN与android原生开发混合后的环境报错问题 需要先安装nodejs$ yarn --version1.12.1更新当前版本yarn upgrade --latest安装 | Yarnhttps: ...

  8. Android 6.0以后的版本报错:open failed: EACCES (Permission denied)

    Android 6.0以后的版本报错:open failed: EACCES (Permission denied) 在开发项目中,遇见要进行文件操作,遇见Caused by: android.sys ...

  9. Android版本28使用http请求报错not permitted by network security policy

    Android版本28使用http请求报错not permitted by network security policy android模拟器调试登录的时候报错 CLEARTEXT communic ...

随机推荐

  1. MsSQL的游标的综合运用

    USE [ChiefWMS]GO/****** Object: StoredProcedure [dbo].[WMS_Check] Script Date: 04/05/2016 09:51:13 * ...

  2. memcached构建集群分析之一

    memcached本身是不支持集群的,集群所关注的容灾.容错.宕机恢复机制统统都没有,实战中需要自己实现容灾机制. memcached集群相比memcached的优势: 巨量数据分布到集群的多台应用主 ...

  3. 怎么删除windows中无用的服务

    搜索cmd->以管理员身份打开 输入sc delete  服务名 回车即可

  4. mysql CASE WHEN的基础和多种用法

    CASE计算条件列表并返回多个可能结果表达式之一. CASE 具有两种格式: 简单 CASE 函数将某个表达式与一组简单表达式进行比较以确定结果. CASE 搜索函数计算一组布尔表达式以确定结果. 两 ...

  5. Python beautifulsoup模块

    BeautifulSoup中文文档:https://www.crummy.com/software/BeautifulSoup/bs4/doc.zh/ BeautifulSoup下载:http://w ...

  6. linux虚拟主机wdcp系列教程之四

    当我们安装了网站服务管理系统wdcp之后,在使用过程中可能会出现这样或那样的疑问,下面给大家整理几点出来,方便大家学习. 1.wdcp支持的在线解压 有时小文件数据量,但整个目录上传会比较慢,如果打包 ...

  7. 教你50招提升ASP.NET性能(十五):解决性能问题时不要低估UI的价值

    (26)Don’t underestimate the value of the UI when tackling performance problems 招数26: 解决性能问题时不要低估UI的价 ...

  8. 飘逸的python - 编码杂症之在字符串前面加u

      有时候我们从其它地方接受的字符串经过艰难跋涉,它变了个样.比如收到的是'\u6253\u602a\u8005'而不是u'\u6253\u602a\u8005'. 明明肉眼看起来只需要加个u,但是怎 ...

  9. GLSL实现Glow效果 [转]

    http://blog.csdn.net/a3070173/archive/2008/11/04/3220940.aspx Glow即辉光效果现在已成为3D图形中一个引人注目的特效.本文主要介绍如何使 ...

  10. Android SDK安装时碰到的问题之解决办法

    问题:hostname in certificate didn't match: <dl-ssl.google.com> != <www.google.com> Fetchin ...