2

The preview of my app in android studio does not show title bars, however when I run the app on my phone the title is there. Why is this and how can I get the software preview to display this?

user3343264
  • 71
  • 1
  • 13

3 Answers3

1

Try this on your Preview pane.

enter image description here

nuuneoi
  • 1,788
  • 1
  • 17
  • 14
  • 1
    Note that if you are using a Toolbar this won't produce the correct results as the preview will show the standard Action Bar and then your Toolbar below it. – Tunga Mar 12 '15 at 15:00
0

This is an issue with the API 22 (5.1) SDK:

https://code.google.com/p/android/issues/detail?id=159793 https://code.google.com/p/android/issues/detail?id=159780

As a temporary workaround you can either uninstall the API 22 SDK and revert to 21, or just tell Android Studio to render against API 21 (5.0) instead (button at the top right of the preview panel).

Tunga
  • 1,014
  • 9
  • 10
0

Well I know the question is quite old but if you are still facing problems then you can go to the Apptheme next to rotation on your xml file and select;

Material Light > Material.Light.DarkActionBar

It worked for me,I was facing the same problem.

Source: https://teamtreehouse.com/community/for-some-reason-my-title-bar-isnt-appearingm-using-android-studio

Burak Tokak
  • 1,810
  • 1
  • 20
  • 27
Vaibhav
  • 771
  • 6
  • 9