我有应用程序,它是在android:Theme.Light中创建的。我想将其更改为Theme.AppCompat.Light.DarkActionBar,但我得到更改android:Theme.Light到Theme.AppCompat.Light.DarkActionBar
没有资源发现,给定名称 “theme.appcompat.light.darkactionbar”
我有匹配android- support-v4.jar,当我尝试添加appcompat_v7我在代码中得到错误,在哪里是这样的R .....我可以添加DarkActionBar到这个项目没有代码的问题?没有修改代码?
我:
<resources>
<!--
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="android:Theme.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>
</resources>
我想:
<resources>
<!--
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- API 14 theme customizations can go here. -->
</style>
</resources>
我得到:找不到与给定名称'@ style/theme.appcompat匹配的资源。 light.darkactionbar'in styles.xml – Michal
您的应用程序是否与支持库正确链接? (有资源,如下所示:https://developer.android.com/tools/support-library/setup.html#add-library) – Shlublu