xuexiangjys / XUI

💍A simple and elegant Android native UI framework, free your hands! (一个简洁而优雅的Android原生UI框架,解放你的双手!)

Home Page:https://xuexiangjys.github.io/XUI/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

新建的项目引入主题报错。

xufeng1026 opened this issue · comments

你好,新建的项目按照引用的教程操作,但在引入主题后,项目启动闪退,是什么原因呀? 引入方式如下:
1.增加:
maven { url "https://jitpack.io" }
2.增加:
//androidx项目
implementation 'com.github.xuexiangjys:XUI:1.2.1'

implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'com.github.bumptech.glide:glide:4.12.0'
3.引入主题

<style name="AppTheme" parent="XUITheme.Phone"> @color/xui_config_color_main_theme @color/xui_config_color_main_theme @color/xui_config_color_main_theme </style>

4.然后编译都成功,但启动app闪退,把主题换成原因的就正常
5.新建项目图片如下
image

后台报这样的错误:
image

你代码的问题, AppTheme默认基类的主题是Theme.AppCompat.Light.NoActionBar,默认是没有ActionBar的,你无法使用setSupportActionBar()