Skip to content Skip to sidebar Skip to footer

Refrencing A Selector Drawable From A Style Results Blank Imagebutton

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 reference

Solution 1:

Here, your are setting style for comment_actions layout, and it is a Relative Layout, which won't be abled to response to your "android:src" attribute.

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/comment_content"
android:orientation="horizontal"
>

<include
    android:id="@+id/like"
    android:layout_width="0dp"
    android:layout_weight="1"
    android:layout_height="wrap_content"
    layout="@layout/comment_actions"
    style="@style/LikeStyle" /> <!--here,you are setting a style for the RelativeLayout -->
</LinearLayout>

Post a Comment for "Refrencing A Selector Drawable From A Style Results Blank Imagebutton"