gpt4 book ai didi

android - 如何让 Holo Light 主题在我的 Xamarin 应用程序中工作

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:25:06 26 4
gpt4 key购买 nike

我正在尝试让我的应用程序使用 Holo.Light 主题。我为 Holo 创建了一个自定义主题并将其放入

资源\values-v11\FsmTheme.xml

<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="FsmTheme" parent="@android:style/Theme.Holo.Light">
</style>
</resources>

我还为旧版本创建了一个并将其放入

资源\值\FsmTheme.xml

<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="FsmTheme" parent="@android:style/Theme.Light.NoTitleBar">
</style>
</resources>

然后我将它添加到我的 AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" android:versionCode="001" android:versionName="001" package="futurestate.app.droid">
<uses-sdk android:minSdkVersion="12" android:targetSdkVersion="14" />
<application android:label="FutureState App Demo" android:icon="@drawable/Icon" Theme="@style/FsmTheme" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>

我不确定我还需要做些什么才能让主题融入应用。

enter image description here

最佳答案

您可以使用属性修改 AndroidManifest.xml 中的值,例如,这会将主题更改为全息灯:

[Activity(
Label = "Foobar",
MainLauncher = true,
Theme = "@android:style/Theme.Holo.Light"
)]
public class MainActivity : Activity { ... }

您也可以在应用程序级别执行此操作。

但是对于您的具体问题,您似乎将样式文件命名为FsmTheme.xml。那是不正确的。您必须将任何样式资源命名为 styles.xml,因此如果您将文件重命名为 Resources/values/styles.xmlResources/values-v11/styles。 xml 一切都应该按预期工作。

关于android - 如何让 Holo Light 主题在我的 Xamarin 应用程序中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20382467/

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