问题描述
我试图实施新的,是由谷歌一对夫妇公布的ActionBar 支持库几天前。在过去,我已经成功实施ActionBarSherlock而不使用在谷歌开发者支持库设置页 - 使用上如何将资源导向(这类似于ActionBarSherlock是如何做到的)。我装在我自己的项目作为一个图书馆以及图书馆计划。
I am trying to implement the new ActionBar support library that was released by Google a couple days ago. In the past, I have successfully implemented ActionBarSherlock without any issues using the same method listed on Google Developer's Support Library Setup page - using the guide on how to include the resources (which is similar to how ActionBarSherlock did it). I have the library project loaded in to my own project as a library as well.
我可以告诉库加载的罚款。而不是在我的MainActivity.java延伸活动时,我把它改为延长ActionBarActivity(根据谷歌的说明),发生任何错误 - 它导入正确
I can tell the library is loading fine. When, instead of extending Activity on my MainActivity.java, I changed it to extend ActionBarActivity (as per Google's instructions), no errors occur - and it imports correctly.
我甚至尝试绕过style.xml文件并添加 @风格/ Theme.AppCompat.Light
直接到AndroidManifest.xml中为 <应用>
和<活性GT;
与安卓主题=@风格/ ThemeAppCompat.Light
与导致同样的错误都尝试。
I even tried bypassing the style.xml file and adding @style/Theme.AppCompat.Light
directly in to the AndroidManifest.xml for both <application>
and <activity>
with android:theme="@style/ThemeAppCompat.Light"
with all attempts resulting in the same error.
现在的问题是,我不能让它改变主题,更不用说甚至建立未抛出错误。以下是错误我收到,其次是style.xml文件我更改为使用新的主题。
Now the issue is I cannot get it to change the theme, let alone even build without throwing an error. Below is the error I am receiving, followed by the style.xml file I changed to use the new theme.
我有中度的经验与Android应用工作,正在运行Eclipse的支持库的最新版本和SDK与API 18(安卓4.3)编制。
I have moderate experience working with Android apps and am running Eclipse with the latest version of the Support Libraries and SDK compiling with API 18 (Android 4.3).
错误接收在构建
错误:错误检索父项:未发现的资源匹配给定名称@风格/ Theme.AppCompat.Light。 styles.xml / ActBarTest / RES /值3号线的Android AAPT问题
style.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.ProsoftStudio.ACTest" parent="@style/Theme.AppCompat.Light">
</style>
</resources>
有什么建议?这是从来没有一个问题ActionBarSherlock。我要工作使用这个新的支持库。它似乎像该.jar加载,而不是资源。
Any suggestions? This was never an issue with ActionBarSherlock. I want to work on using this new support library. It almost seems like the .jar is loading, but not the resources.
推荐答案
您下一步需要做的:
- 文件 - >导入(Android的SDK \演员\机器人\ SUPPORT \第7版)。选择appcompat
- 在项目 - >属性 - > Android系统。在部分库添加,然后选择appCompat
- 这就是全部!
注:如果您使用的是机器人:showAsAction菜单项,您需要更改preFIX机器人作为例子http://developer.android.com/guide/topics/ui/actionbar.html
Note: if you are using "android:showAsAction" in menu item, you need to change prefix android as in the example http://developer.android.com/guide/topics/ui/actionbar.html
这篇关于找不到Theme.AppCompat.Light新的Android动作条支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!