Issue
I have a TextView. I have a selector to change the text colour on press. If I reference the selector inline (like below), it works.
<TextView style="@style/DefaultLinkText" android:textColor="@drawable/tmp_hyperlink_textColor"/>
If I move the inline reference into a style in the Styles.xml, it can't find it.
<style name="DefaultLinkText">
<item name="android:clickable">true</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:textColor">@drawable/tmp_hyperlink_textColor</item>
<item name="android:ellipsize">end</item>
</style>
Any ideas why it can't find my drawable selector? I reference other drawables within my styles, but they are for background not textColor.
Solution
After lots of searching... I found that I was referencing it correctly, but it didn't like the file name! So I changed my file name from: tmp_hyperlink_textColor to: tmp_hyperlink_text_color
It didn't like the textColor name in the file name! So I must remember to name all xml files with lower case underscores.
Answered By - Daisy
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.