gpt4 book ai didi

java - 如何为所有 Android 应用程序设置 Holo 灯光主题

转载 作者:行者123 更新时间:2023-12-02 04:35:52 24 4
gpt4 key购买 nike

我不小心在布局中做了一些事情,现在我的所有 Activity 都是深色的,带有白色文本“在 TextViews 内”,之前所有 Activity 都是灰色带有黑色文本,当我在互联网上搜索时,我相信我以某种方式改变了从“Holo light”到“Holo dark”的所有 Activity ,如何恢复默认主题?

PS。我不认为问题出在布局上,因为我没有碰过它们。附言。这是我的 list :

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.excellence.youniversity"
android:versionCode="2"
android:versionName="1.1" >

<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="22" />

<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true" />

<application
android:allowBackup="true"
android:icon="@drawable/blue"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".CoursesActivity"
android:label="@string/title_activity_courses"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".Technology"
android:label="@string/title_activity_technology"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".Science"
android:label="@string/title_activity_science"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".Langauges"
android:label="@string/title_activity_langauges"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".Thinking"
android:label="@string/title_activity_thinking"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".Art"
android:label="@string/title_activity_art"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".Medicine"
android:label="@string/title_activity_medicine"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".RoboticActivity"
android:label="@string/title_activity_robotic"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".TechActivity"
android:label="@string/title_activity_tech"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".AndroidActivity"
android:label="@string/title_activity_android"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".WedooActivity"
android:label="@string/title_activity_wedoo"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".AndroiddActivity"
android:label="@string/title_activity_androidd"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".CSIActivity"
android:label="@string/title_activity_csi"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".ChemistryActivity"
android:label="@string/title_activity_chemistry"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".AstronomyActivity"
android:label="@string/title_activity_astronomy"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".ArchitectureActivity"
android:label="@string/title_activity_architecture"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".AstronomyyActivity"
android:label="@string/title_activity_astronomyy"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".FashionActivity"
android:label="@string/title_activity_fashion"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".PhotographyActivity"
android:label="@string/title_activity_photography"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".VideoActivity"
android:label="@string/title_activity_video"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".EnglishActivity"
android:label="@string/title_activity_english"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".ChessActivity"
android:label="@string/title_activity_chess"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".BudActivity"
android:label="@string/title_activity_bud"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".FirstaidActivity"
android:label="@string/title_activity_firstaid"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".AboutUs"
android:label="@string/title_activity_about_us"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
</application>
</manifest>

这是值文件夹内的 Styles.xml

<!--
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="Theme.AppCompat.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">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>

最佳答案

您已在 Activity 中设置了 android:theme="@android:style/Theme.NoTitleBar",该样式将为您提供 Holo Dark 主题。

您必须将其替换为

android:theme="@android:style/Theme.Light.NoTitleBar"

关于java - 如何为所有 Android 应用程序设置 Holo 灯光主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30764232/

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