When doing web development, you can check the element and see which classes provide the css rules. Is there an equivalent for Android development?
TL; DR; Here is an example of a style inheritance problem that I solved and solved:
I had a Holo theme dialog box, but the text color was dark even when I tried to set the text color to white.
This dialog box:
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content"> <ListView android:id="@android:id/list" android:layout_width="wrap_content" android:layout_height="wrap_content" style="@style/Theme.Dialog"/> </RelativeLayout>
In the style.xml resource:
<style name="Theme.Dialog" parent="android:style/Theme.Holo.Dialog"> <item name="android:windowTitleStyle">@android:style/TextAppearance.Large</item> <item name="android:textColor">@color/solid_white</item> <item name="android:windowNoTitle">true</item> </style>
It turned out that I used Fragment , whose Activity was ListActivity , and it defined getView, which created a view from the xml style, which set the text color to dark. It would be interesting to see what sets the color of the text.
Rose perrone
source share