Caused by: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.
代码报错位置:
setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
最近使用recycleview的时候,下拉的时候出现顶部图片,标题也随着下滑。报了一个错
解决方法:在styles文件里添加
<style name="AppTheme.NoActionBar" parent="AppTheme"> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> </style>
然后在
更改成AppTheme.NoActionBar
完工。