Так что мой просмотрщик в Android студии, показывая мне, что стили проводятся
(я бы разместить изображение, но у меня нет репутации)стилей XML не применяются при запуске андроид приложение
Однако, когда я бегу приложение стили исчезают, но только те, которые указаны в styles.xml
activity_main.xml:
<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"
tools:context=".MainActivity">
<RelativeLayout
android:theme="@style/header"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="20dp"
android:paddingTop="20dp">
<TextView
android:id="@+id/welcome_text"
android:text="@string/hello_world"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="20dp"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="125dp">
<ListView
android:id="@+id/option_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</ListView>
</RelativeLayout>
</RelativeLayout>
styles.xml:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="android:colorBackground">#eee</item>
</style>
<style name="header">
<item name="android:textColor">#ff43a2ff</item>
<item name="android:textSize">60dp</item>
<item name="android:layout_centerInParent">true</item>
<item name="android:layout_gravity">center</item>
</style>
</resources>
Есть ли что-то, что я делаю неправильно?!?
Спасибо! Это прекрасно работает! Самая запутанная часть интересовала, почему предварительный просмотр показывал то, что я хотел .... –
рад помочь :) –