當我創建任何應用程序時,Android總是給我相同的標題欄。我需要做些什麼來定製它(背景和文字)?也許更改style.xml或更改onCreate()
方法?在Android中自定義標題欄默認值
我更新的AndroidManifest.xml和styles.xml:
@ AndroidManifest.xml中
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app.searchmedicinelayout"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.app.searchmedicinelayout.SearchMedicineActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".DetailMedicine"
android:label="@string/detail"
android:parentActivityName="com.app.searchmedicinelayout.SearchMedicineActivity" >
</activity>
</application>
</manifest>
@ styles.xml
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
</style>
</resources>
我只是想改變標題欄上的背景,並設置文本中心和更改大小。當我創建項目時,AndroidManifest是默認的。我已經更新了頂部的2個文件。 – user2353978