android开发training之actionbar之1

来源:互联网 发布:网络业务员怎么找客户 编辑:程序博客网 时间:2024/06/03 00:13

action bar很有用,可以提示用户所处的位置,或加入搜索,设置等功能。


Support Android 3.0 and Above Only


Beginning with Android 3.0 (API level 11), the action bar is included in all activities that use theTheme.Holo theme (or one of its descendants), which is the default theme when either thetargetSdkVersion or minSdkVersion attribute is set to "11" or greater.

API11起步的用Theme.Holo主题的theme的activity(targetSdkVersion或者minSdkVersion的值是11或者以上的默认标题是Theme.Holo),action bar默认出现在顶部。

So to add the action bar to your activities, simply set either attribute to 11 or higher. For example:

要想在activity中加action bar,只需像下面这样:

<manifest ... >    <uses-sdk android:minSdkVersion="11" ... />    ...</manifest>
对于Android2.1及以上(现在很少使用)的应用,可以查看官方文档。
0 0