Why does Android Studio always show ActionBar in app design, even when disabled?

后端 未结 2 1152
北海茫月
北海茫月 2021-02-20 11:35

I have an application in new Android Studio 1.4 (nonetheless this issue was present at 1.3.2 as well) and I have decided to go with toolbar instead of actionbar because of the e

相关标签:
2条回答
  • 2021-02-20 12:13

    As you may instantiate a layout in any number of ways with any style you can view how your layout looks in different styles by clicking the button as shown in the image. If you don't set another style or theme in your code then the theme in your manifest will be used.

    0 讨论(0)
  • 2021-02-20 12:17

    This was quite easy in the end. I just changed styles.xml from

     <!-- Base application theme. -->
        <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    

    to

    <!-- Base application theme. -->
        <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    

    I have no idea why this affects designer view, as when launched, both versions provide identical layout without actionbar (as I use AppTheme.NoActionBar which is defined in styles.xml) I guess it is an Android Studio design rendering bug.

    0 讨论(0)
提交回复
热议问题