xmlコードの繰り返しを減らしたい。だから、私はtextViewでテキストのいくつかの標準スタイルを作った。 textViewでは 'style'属性と 'android:textAppearance'属性の両方でスタイルを適用できます。以下はtextColorを含むスタイルがtextViewのtextAppearanceに適用されるときに、テキストの色が変化しない
私は「textAppearance」の下でこれらのスタイルを適用すると、私はテキストのために作られたいくつかのスタイルは、テキストの色は、上記のスタイルのいずれにも変更されていない属性
<style name="Grey">
<item name="android:textColor"> #333333 </item>
</style>
<style name="CodeFont" parent="@android:style/TextAppearance.Medium">
<item name="android:textColor"> #00FF00 </item>
<item name="android:typeface">monospace</item>
<item name="android:textSize">20sp</item>
</style>
をappearance-ています。 textViewの 'style'属性の下で動作しています。
//textColor not working
<TextView
android:id="@+id/profile_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Full Name"
android:textAppearance="@style/CodeFont"/>
//textColor working
<TextView
android:id="@+id/profile_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Full Name"
style="@style/CodeFont"/>
私は「スタイル」属性の下にいくつかの他のスタイルを適用できるように、彼らは「textAppearance」属性の下で仕事をしたいです。 android documentationによると、 'textAppearance'属性の下にtextColorスタイルを適用することができます。
解決策を提案してください。 おかげ