海拔仅适用于Android 5.x +,因此您必须更改编译为使用5.0或更高版本。
您/Resources/values/style.xml应该或多或少是:
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="MyTheme" parent="MyTheme.Base">
</style>
<style name="MyTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
<item name="windowNoTitle">true</item>
<!--We will be using the toolbar so no need to show ActionBar-->
<item name="windowActionBar">false</item>
<!-- Set theme colors from http://www.google.com/design/spec/style/color.html#color-color-palette-->
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">#00FFAA</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name="colorPrimaryDark">#004D40</item>
<!-- colorAccent is used as the default value for colorControlActivated
which is used to tint widgets -->
<item name="colorAccent">@color/accent</item>
<!-- You can also set colorControlNormal, colorControlActivated
colorControlHighlight and colorSwitchThumbNormal.
<item name="colorControlNormal">#00897B</item>
<item name="colorControlActivated">#1DE9B6</item>-->
<item name="windowActionModeOverlay">true</item>
</style>
</resources>
还要检查你的style.xml在你的/资源/文件夹值,并确保您为API级别V21 +风格是这样的:在BuildAction的/Resources/values-v21/style.xml
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<!--
Base application theme for API 21+. This theme replaces
MyTheme from resources/values/styles.xml on API 21+ devices.
-->
<style name="MyTheme" parent="MyTheme.Base">
<item name="android:windowContentTransitions">true</item>
<item name="android:windowAllowEnterTransitionOverlap">true</item>
<item name="android:windowAllowReturnTransitionOverlap">true</item>
<item name="android:windowSharedElementEnterTransition">@android:transition/move</item>
<item name="android:windowSharedElementExitTransition">@android:transition/move</item>
</style>
</resources>
我改变了编译版本为你描述:我摆脱错误的,但我得到另一个错误:java.lang.OutOfMemoryError。考虑增加$(JavaMaximumHeapSize)的值。 Java运行时内存不足,执行'java.exe –
@MohamedAhmed转到您的Android选项 - >高级选项卡 - >高级Android构建设置并将Java堆大小设置为1G,例如 – Ingenator
@Amit Kumar,我一直想知道...为什么他们甚至让人们在那里设置KitKat 4.4?是否有配置可以工作的场景? – Marshall