English 中文(简体)
如何执行 Android 4. 0 版本的动作栏?
原标题:How to implement the action bar for Android version 4.0?

我应用了一个程序,它从 2.1 和 。但我的应用程序有退出应用程序的菜单功能。我安装了冰红三明治(ICS, 4. 0 版本)设备,操作正常。但是, ICS 没有菜单按钮 - 而不是这个按钮。 我对这个概念很新。 我想将它融入我的应用程序。 我尝试过,但我没有成功。

为此,我遵循这些步骤:

  1. android:targetSdkVersion="11" in the Android manifest.
  2. android:showAsAction="ifRoom|withText" --> add to menu.xml (which is in the menu folder) but I get the following error:

找不到用于 属性显示显示的资源标识符。 As As As Action in pack and mid

最佳回答

您应该从工作 < a href=\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

设置 目标SdkVersion :

打开您的工程属性, 选择 Android, 并选择一个 Android SDK 来连接您的工程。 对于工程属性和您的 < a href=> http:// developmenter.android.com/ guide/ optics/ fundamentals.html# Manifest" rel = “ nofollow norefererr” >Android宣言 targetSdkVersion , 我建议使用最新的 SDK 。

"https://i.sstatic.net/q36Hi.jpg" alt="Screen shot 演示设定目标SdkVersion"/>

minSdkVersion 定义了该应用程序将运行的最低版本的Android 。 targetSdkVersion 定义了该应用程序所知道的最高版本的Android, 该应用程序何时构建 -- -- 哪些类别和方法可供使用,哪些常数可定义,等等。 它可能在更新版本中运行, 但不会知道在 targetSdkVersion 之后添加的任何特性 。

有关"的更多信息:http:// developmenter.android.com/guide/appendix/apendix/api-levels.html" rel=“不跟随 noreferrer" >API level

如果您想要在 Android & lt; 3. 0 上显示一个动作栏, 请在 < a href=" http:// actionbarsherlock.com/" rel=" no follown norefreerr" > Action Bar Sherlock 或 < a href=" "http:// developer.android.com/resources/samples/ ActionBarCompat/index. html" rel= "nofollown noreferr" > > Action Bar Complitibility SDK的样本上显示一个工程。 但是在您对您的动作栏在 & gt; = 3. 0 中感到舒适之前, 不要尝试它 。

问题回答

http://www.vogella.com/articles/Android/article.html#menu_tumental" rel=“no follow”>这里。





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签