Created
November 22, 2014 01:03
-
-
Save siyamed/7278413851d3a1d02ffc to your computer and use it in GitHub Desktop.
Android RadioButton With Text Drawable Aligned Centered With Text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<declare-styleable name="ImageRadioButton"> | |
<attr name="radioTextImage" format="reference" /> | |
</declare-styleable> | |
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item android:state_checked="true" android:drawable="@drawable/my_drawable_selected" /> | |
<item android:state_pressed="true" android:drawable="@drawable/my_drawable_selected" /> | |
<item android:drawable="@drawable/my_drawable" /> | |
</selector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<com.github.siyamed.gist.ImageRadioButton | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:gravity="center" | |
android:button="@null" | |
android:text="RadioText" | |
app:radioTextImage="@drawable/radio_selector"/> |
It not working android 7.0
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how do I set radioTextImage via java?