Android studio preview pane not rendering ActionBar?
Solution 1
Unfortunately it is low priority.
Update: set the preview to API 22
Solution 2
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">
Related videos on Youtube
Sainath S.R
Love software.Here to get help and give back to the community :) . Currently working as a software developer.
Updated on September 15, 2022Comments
-
Sainath S.R over 1 year
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!
-
Sainath S.R over 9 yearsI'm sorry i don't really understand ,my Main Activity and fragment do extend ActionBarActivity and moreover i said it works fine on the device etc,only the preview pane is messed up.
-
vinay Maneti over 9 yearsyoutube.com/watch?v=h57QpXp2TRg watch this video you can understand
-
lemuel about 9 yearsIs it really? Because I'm noticing a possible side effect: when I select a NoActionBar theme from the Preview tools, it still has an action bar.
-
Menachem Hornbacher about 9 yearsIt was fixed with minor issues in platform tools 22
-
lemuel about 9 yearsWeird. I definitely have platform tools 22. I'm not setting any Activity context in xmlns:tools. The ActionBar is there, my ToolBar goes below it even if I chose Theme.AppCompat.NoActionBar from the preview pane. Unrelated, but just to be clear: I just extend Activity (because I'm using Flow), and my AppTheme is also Theme.AppCompat.NoActionBar.
-
Menachem Hornbacher about 9 yearsRead the link. There is still isuues in some configurations
-
vishal dharankar almost 9 yearsQuestion is about preview and not runtime appearance .