标签:
设置miniSdkVersion 为11或以上,默认设置Theme.Holo主题,此主题自带ActionBar
提供向上的导航(类似于微信聊天界面左上的左箭头)
1. android 4.1(16)以后可通过在manifest.xml中activity标签android:parentActivityName指定上一个activiy.
2.android 4.1以前可通过添加support library v7 然后在activity标签中添加<meta-data>子标签,设置android.support.PARENT_ACTIVITY属性为上一个activity
示例:
<application ... >
...
<!-- The main/home activity (it has no parent activity) -->
<activity
android:name="com.example.myfirstapp.MainActivity" ...>
...
</activity>
<!-- A child of the main activity -->
<activity
android:name="com.example.myfirstapp.DisplayMessageActivity"
android:label="@string/title_activity_display_message"
android:parentActivityName="com.example.myfirstapp.MainActivity" >
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.myfirstapp.MainActivity" />
</activity>
</application>
标签:
原文地址:http://www.cnblogs.com/vagrant1991/p/4319567.html