![](/img/trans.png)
[英]Appcelerator/Titanium Android theme - Failed to package application
[英]Titanium/Appcelerator: Cannot find Android theme
我正在使用Titanium / Appcelerator構建一個Android應用程序,並且正在遵循有關Android主題的指南 。 根據指南,要使用默認的Android主題之一,您必須:
我已經做到了,但是在嘗試構建時出現錯誤:
錯誤:找不到與給定名稱匹配的資源(在“主題”中值為“ @ style / Light”)。
我注意到,我在上述目錄結構中創建的主題XML文件也已消失。 為什么是這樣? 我怎樣才能使主題發揮作用?
似乎您正在將主題文件放入Alloy生成的文件夾中,並在每次構建時對其進行清理。
主題文件的正確結構是這樣的:
請注意位於應用程序-平台-android-res-values文件夾中的themes.xml文件。
這可能是您的themes.xml文件的演示內容
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="CustomTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">#ff0000</item>
<item name="colorAccent">#00ff00</item>
</style>
</resources>
現在,您將主題名稱命名為CustomTheme ,因此可以在tiapp.xml文件中設置該名稱,如下所示:
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<application android:theme="@style/CustomTheme">
</application>
</manifest>
</android>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.