如何在我的Xamarin应用程序中使用Holo Light主题 [英] How to get Holo Light theme working in my Xamarin application

查看:88
本文介绍了如何在我的Xamarin应用程序中使用Holo Light主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm trying to get my app to use the Holo.Light theme. I've created a custom theme for Holo and put it in

资源\值-v11 \ FsmTheme.xml

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

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

I've also created one for older versions and put it in

资源\值\ 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>

我不确定我还需要做些什么才能使主题融入应用程序中.

I'm not sure what else I would need to do to get the theme to take in the app.

推荐答案

细目在这行上.

<application android:label="FutureState App Demo" android:icon="@drawable/Icon" Theme="@style/FsmTheme" />

其中一些教程显示

Theme="@style/ThemeName"

但是您实际上应该将其结构与元素的其余部分相同

but you should actually structure it the same as the rest of the element

android:theme="@style/ThemeName"

因此最终结构将显示为

<application android:label="FutureState App Demo" android:icon="@drawable/Icon" android:theme="@style/FsmTheme" />

这篇关于如何在我的Xamarin应用程序中使用Holo Light主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆