2014-10-17 49 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

相关问题