2014-10-17 21 views
-3

我正在研究一個應用程序,我想知道如何從我的應用程序編輯設置選項卡。我想添加例如關於我們頁面和共享頁面。謝謝!如何從我的android應用程序編輯設置選項卡?

+1

歡迎。閱讀[詢問一個好問題]的文檔(http://stackoverflow.com/help/how-to-ask)。 – 2014-10-17 07:38:26

回答

0

main.xml中做出不同的菜單items..ie

<menu xmlns:android="http://schemas.android.com/apk/res/android" > 

    <!-- Search, should appear as action button --> 
    <item 
     android:id="@+id/action_search" 
     android:showAsAction="ifRoom" 
     android:title="SKIP"/> 
    <item 
     android:id="@+id/icon" 
     android:enabled="true" 
     android:title="" 
     android:icon="@drawable/ic_action_share" 
     android:showAsAction="ifRoom"/> 

</menu> 

完蛋了........#2

+0

用於回調........ @重寫 \t公共布爾onOptionsItemSelected(菜單項項) \t { \t開關(item.getItemId()) \t { \t情況android.R.id.home: \t \t finish(); \t \t \t onBackPressed(); \t返回true; \t情況R.id.action_search: \t \t \t \t Toast.makeText(getApplicationContext(), 「dffds」,2000).show(); \t \t return true; \t默認值: \t return super.onOptionsItemSelected(item); \t} \t} – 2014-10-17 08:02:46

+0

謝謝。它現在完美。 – PanaitStudio 2014-10-17 08:13:26

相關問題