I want to have a ImageButtons changing the image based on its state. (same as "like" button in nine gag and facebook apps).
I have defined a style for each of them that references a selector as a drawable but when I run the program, images doesn't appear. Can you tell me what's wrong with this approach? (sorry for my bad English)
comment_actions_style in values folder:
<style name="LikeStyle"> <item name="android:src">@drawable/like</item> </style> <style name="DislikeStyle"> <item name="android:src">@drawable/dislike_normal</item> </style> <style name="ReplyStyle"> <item name="android:src">@drawable/reply_normal</item> </style> <style name="ShareStyle"> <item name="android:src">@drawable/share</item> </style> </resources> and like drawable in drawable folder: (other buttons are the same)
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/like_clicked" android:state_pressed="true"/> <!-- pressed --> <item android:drawable="@drawable/like_focused" android:state_focused="true"/> <!-- focused --> <item android:drawable="@drawable/like_normal"/> <!-- default --> </selector> These buttons also inherit from a layout if that's matter.
Mayans camilla belle instagram Robert Bork mark sanchez Mayan End Of The World Olivia Black
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন