Skip to content Skip to sidebar Skip to footer

Removing The Default Toolbar In An Activity Android

Before upgrading to android 3.1.I usually just change the theme to a theme. app compact. NoTitleBar but the new version of android studio is having errors recognizing it.I solved t

Solution 1:

In your res/values/styles.xml you have this similar block of code. Ensure that you use Theme.AppCompat.Light.NoActionBar as parent of your theme

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

Solution 2:

Add this style in style file . where other styles are mentioned . 


<!-- Base application theme. --><stylename="AppThemeNoActionBar"parent="Theme.AppCompat.Light.NoActionBar"><itemname="colorPrimary">@color/colorPrimaryDark</item><itemname="colorPrimaryDark">@color/colorPrimaryDark</item><itemname="colorAccent">@color/colorPrimaryDark</item><itemname="android:statusBarColor">@color/lightgreycolor</item></style>

Solution 3:

In my case, i had to change parent theme in res/values/themes.xml

enter image description here

Post a Comment for "Removing The Default Toolbar In An Activity Android"