2017-12-19 8 views
0

ボタンのリストアップを示しています。アクションバーではなく、私はこのようになりますアプリのアクションバー持つ

enter image description here

は、今私はかなり確信しているが、私は上のデフォルトのテーマを持っていませんアプリだが、私はリストの代わりにボタンを得ることを望んでいた。この種の何か。

enter image description here

<menu xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:android="http://schemas.android.com/apk/res/android"> 
    <item 
     android:id="@+id/action_shuffle" 
     android:icon="@mipmap/ic_shuffle_black_18dp" 
     android:title="Shuffle" 
     app:showAsAction="always" 
     android:checkable="true" 
     android:checked="false" 
     /> 

    <item 
     android:id="@+id/action_end" 
     android:icon="@mipmap/ic_close_black_18dp" 
     android:title="End" 
     app:showAsAction="always" /> 
</menu> 

私はalwaysからshowasactionセットを持って、それはまだそれをリストとして表示されます。

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.example.tilak.imusicplay"> 
    <uses-permission android:name="android.permission.WAKE_LOCK" /> 
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> 
    <application 
     android:allowBackup="true" 
     android:icon="@drawable/playicon" 
     android:label="@string/app_name" 
     android:roundIcon="@mipmap/ic_launcher_round" 
     android:supportsRtl="true"> 
     <activity android:name="com.example.tilak.imusicplay.MainActivity" 
      android:label="@string/app_name" 
      android:launchMode="singleTop" 
      android:screenOrientation="portrait"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN"/> 
       <category android:name="android.intent.category.LAUNCHER"/> 
      </intent-filter> 
     </activity> 
     <service android:name="com.example.tilak.imusicplay.MusicService" /> 
    </application> 
</manifest> 

私は何かを逃しています:

マニフェストは次のようになりますか?なぜボタンが表示されないのですか?私のプレビューで見たように?

更新:

必要があれば、全体コードをアップロードできますか?

+0

に[アプリでアイテム:showAsActionが表示されていない]の可能性の重複をチェックしてくださいあなたは

android:showAsAction="always" 

に設定する必要がありそれとも、APPCOMPAT にあなたのテーマを設定する必要があります(https://でのstackoverflow.com/questions/26377305/item-with-appshowasaction-not-showing) –

答えて

関連する問題