Material Design出现You need to use a Theme.AppCompat theme (or descendant) with this activity
来源:互联网 发布:网络连接助手 编辑:程序博客网 时间:2024/06/04 08:43
You need to use a Theme.AppCompat theme (or descendant) with this activity问题
因为你虽然在Activtiy里写上了extends AppCompatActivity
但却在AndroidManifest.xml里的主题还是默认的主题.AppTheme或者其他不相符合的主题。这就有就挂羊头卖狗肉的问题。
所以我们只要在该activity里面的或者application(会对该应用里面的activity都起作用)里面的主题改为
android:theme=”@style/Theme.AppCompat”就可以完美的解决你的问题。
顺便提一个这个问题
This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.
根据提示,你可以很快知道是你定义的activity里面定义了一个类似actionbar的导航条,而默认也应用也拥有actionbar,造成两者的冲突。
这样你可以在主题中修改成以下,就可以完美解决你的问题
android:theme=”@style/Theme.Xxx.NoActionBar”
0 0
- Material Design出现You need to use a Theme.AppCompat theme (or descendant) with this activity
- 关于“you need to use a theme.appcompat theme (or descendant) with this activity”错误
- Android开发~you need to use a theme.appcompat theme (or descendant) with this activity
- You need to use a Theme.AppCompat theme (or descendant) with this activity
- You need to use a Theme.AppCompat theme (or descendant) with this activity解决方法
- You need to use a Theme.AppCompat theme (or descendant) with this activity.
- You need to use a Theme.AppCompat theme (or descendant) with this activity解决方法
- 【Android】You need to use a Theme.AppCompat theme (or descendant) with this activity解决方法
- You need to use a Theme.AppCompat theme (or descendant) with this activity
- You need to use a Theme.AppCompat theme (or descendant) with this activity解决
- you need to use a theme.appcompat theme (or descendant) with this activity 解决办法
- You need to use a Theme.AppCompat theme (or descendant) with this activity.
- You need to use a Theme.AppCompat theme (or descendant) with this activity.
- You need to use a Theme.AppCompat theme (or descendant) with this activity解决方法
- You need to use a Theme.AppCompat theme (or descendant) with this activity.
- 报错 You need to use a Theme.AppCompat theme (or descendant) with this activity.
- Android Studio You need to use a Theme.AppCompat theme (or descendant) with this activity解决方法
- 关于You need to use a Theme.AppCompat theme (or descendant) with this activity的问题
- 伪类和伪元素的区别
- 多种方式实现底部菜单栏(仿微信界面)
- 八卦天盘
- Ubuntu上hi3531交叉编译环境arm-hisiv100nptl-linux搭建过程
- Java day05 final 关键字
- Material Design出现You need to use a Theme.AppCompat theme (or descendant) with this activity
- Mybatis 示例之 Association
- English - Grammar(未完)
- Java中使用正则表达式
- Makefile的编写
- 2333333333
- Spring3.x JSR-303
- FastDFS配置文件详解之storage.conf
- 使用SecureCRT自动保存设备登陆日志