android - Make TextView bold using selector -



android - Make TextView bold using selector -

when user presses textview, i'd create textview bold. i'm trying:

// styles.xml <style name="texton"> <item name="android:textstyle">bold</item> </style> <style name="textoff"> <item name="android:textstyle">normal</item> </style> // my_selector.xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="true" android:state_pressed="true" style="@style/texton" /> <item android:state_focused="false" android:state_pressed="true" style="@style/texton" /> <item android:state_focused="true" style="@style/texton" /> <item android:state_focused="false" android:state_pressed="false" style="@style/textoff" /> </selector> // textview in layout <textview ... android:duplicateparentstate="true" android:textappearance="@drawable/my_selector" />

setting textappearance selector drawable doesn't seem right, , in fact, has no effect. how this?

thanks

applying selector style works colors , drawables. please see reply in post below.

how define bold in android selector

android

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -