ele*_*ant 33 android android-appcompat android-actionbar android-actionbar-compat
我正在使用AppCompat将我的应用程序移植到API7,并且操作栏出现问题.
当我使用FragmentActivity动作栏时显示在我的手机上(API18),但是ActionBarActivity按下menubutton会显示为选项菜单.
在具有API7的模拟器上,操作栏始终显示为选项菜单.
有任何想法吗?
flx*_*flx 70
使用compat名称空间为您的菜单项,如下所示:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:compat="http://schemas.android.com/apk/res-auto" >
<item android:id="@+id/action_whatever"
android:icon="@drawable/ic_action_whatever"
android:title="@string/whatever"
compat:showAsAction="ifRoom" />
</menu>
Run Code Online (Sandbox Code Playgroud)