I'm running the latest version of android studio ,Problem is the preview pane does not render the ActionBar when any of the AppCompat themes are used, if i change the theme of the preview pane it works fine(Not change actual theme) ,but is there any discepency in doing this,
my styles.xml is as follows
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
</resources>
when the preview pane is set to AppTheme ,the ActionBar ain't shown ,however it works fine in my device and AVD,
As you can see this makes it hard to debug and test the ActionBar
Please suggest some fix to this and how exactly does a AppCompat theme differ from an ordinary one?,I'm just an android beginner .
Thanks!
Android ActionBar is a menu bar that runs across the top of the activity screen in android. Android ActionBar can contain menu items which become visible when the user clicks the “menu” button.
The key differences that distinguish the Toolbar from the ActionBar include: Toolbar is a View included in a layout like any other View. As a regular View , the toolbar is easier to position, animate and control. Multiple distinct Toolbar elements can be defined within a single activity.
The app bar, also known as the action bar, is one of the most important design elements in your app's activities, because it provides a visual structure and interactive elements that are familiar to users.
An on-screen toolbar displaying icons that are clicked or tapped to perform various functions. For example, the menu bar at the top of an Android app is called an action bar.
It is a bug: https://code.google.com/p/android/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars&groupby=&sort=&id=78944
Unfortunately it is low priority.
Update: set the preview to API 22
In my styles.xml I had
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
had to change it to just
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With