您的位置:首页 > 移动开发

Android问题一:You need to use a Theme.AppCompat theme (or descendant) with this activity.

2016-05-19 08:35 549 查看
activity 继承 AppCompatActivity 后设置默认titlebar不显示时会出现这样的错误。改正办法如下:

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>


只需要将parent中的代码改为如上代码即可。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android