ActionBar不受支持

时间:2015-04-21 14:33:15

标签: android android-fragments android-actionbar android-navigation

我在Android中的应用程序中显示操作栏时遇到问题< 5.0。

^^在4.4中,它不显示。操作栏不可见

但同样的应用程序在android 5.0中打开时显示完美。

My activity_main
http://pastebin.com/F2c6BGj9
Manifest
http://pastebin.com/AJ7pnbMB
drawer_row
http://pastebin.com/L6de0TnM
styles.xml
http://pastebin.com/0tVpDV3M

1 个答案:

答案 0 :(得分:2)

我认为是因为你的风格是:

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">

尝试:

<style name="AppTheme" parent="Theme.AppCompat.Light">

<强>更新

你的logcat说:

This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.

您必须在活动中致电Window.FEATURE_ACTION_BAR并且您还没有发布您的java代码,在查看main_activity.xml中的代码后,我相信您正在使用工具栏,不是行动吧,所以也许我给你的答案不会起作用,看着thisthisthis我认为你应该把它放在我之前说过的话:

<item name="windowActionBar">false</item>