gpt4 book ai didi

android - 在android中自定义标题栏默认值

转载 作者:行者123 更新时间:2023-11-29 01:52:55 25 4
gpt4 key购买 nike

<分区>

当我创建任何应用程序时,Android 总是给我相同的标题栏。我需要做什么来自定义它(背景和文本)?也许更改 style.xml 或更改 onCreate() 方法?

我更新了 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>

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com