Я следующий style.xml
в res/values/
папке:Стиль отображается в эмуляторе, но не на моем устройстве
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:colorBackground">#000000</item>
</style>
и следующий макет для моей основной деятельности, где я использовал style="@style/AppTheme"
:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
style="@style/AppTheme" // here I've used It.
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.kaushal28.wakeupplease.MainActivity">
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Start"
android:id="@+id/startAlarm" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/stop"
android:text="Stop"/>
</LinearLayout>
</RelativeLayout>
У меня устройство с Android 4.2.2 Jelly Bean и эмулятор имеют последний Marsh mellow. Я думаю, что проблема заключается только в этой разнице. У меня минимальный SDK версии 15 для этого проекта.
Я попытался изменить targetSDKVersion
на 15 в Build.Gradle
. Но это не могло решить мою проблему.
Я ожидаю, что черный цвет фона.
Что не настраивается? Можно ли поделиться некоторыми снимками экрана? – W0rmH0le
okay wait ....... –
@GuilhermeP посмотреть скриншоты –