android開發training之actionbar之1

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及以上(現在很少使用)的應用,可以查看官方文檔。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章