简体   繁体   中英

No Action Bar shown when using AppCompat-Theme and Activity

Okay, I'm gonna keep this as simple as possible:

I have two styles, one for users of API 21 (Lollipop) and a default one for everything between API 14 and 21.

When the parent theme inherits from the AppCompat library (eg Theme.AppCompat.Light) there is no action bar shown when using Activity classes.

I know I can use ActionBarActivity for this. The problem is that I use the theme Material.Light when running on version 21 which isn't compatible with ActionBarActivity. What's the best solution for this problem?

What's the best solution for this problem?

Pick one action bar implementation and stick with it. Either use appcompat-v7 for all API levels, or use the native action bar for all API levels. Note that the appcompat-v7 action bar backport looks a lot like the Theme.Material action bar, as part of the vision of appcompat-v7 is to bring the Material Design aesthetic to older devices.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM