Custom Checkbox changes its size when isChecked is true Android? -
Custom Checkbox changes its size when isChecked is true Android? -
i have single selection expandablelistview custom checkbox defined drawable created in android asset studio.
for reason, when checkbox checked looks smaller when not. checked if made error size of images , have same size. (disabled or enabled).
here's code of custom checkbox:
drawable/custom_checkbox.xml
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/ic_success_enabled" android:state_checked="true" android:state_focused="true"/> <item android:drawable="@drawable/ic_accept_disabled" android:state_checked="false" android:state_focused="true"/> <item android:drawable="@drawable/ic_accept_disabled" android:state_checked="false"/> <item android:drawable="@drawable/ic_success_enabled" android:state_checked="true"/> </selector> my drawable/ic_success_enabled & disabled are:
the rows each element in expandablelistview
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/relativelayout1" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:padding="5dp" > <textview android:id="@+id/title_one_item" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparenttop="false" android:layout_centervertical="true" android:layout_toleftof="@+id/one_item_checkbox" android:layout_torightof="@+id/one_item_row_image" android:padding="10dp" android:textappearance="?android:attr/textappearancelarge" android:textcolor="@color/akdemia_0_black" /> <com.akdemia.application.circularimageview android:id="@+id/one_item_row_image" android:layout_width="50dp" android:layout_height="50dp" android:layout_alignparentleft="false" android:layout_alignparenttop="false" android:layout_centervertical="true" android:src="@drawable/placeholder_icon_iphone" /> <checkbox android:id="@+id/one_item_checkbox" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentright="true" android:layout_centervertical="true" android:background="@drawable/akdemia_checkbox" android:button="@null" android:focusable="false" /> </relativelayout> and here screen shot of expandablelistview, guys can see problem: (all orange rectangles added on purpose, ignore them)
hope can help me this, in advance!
give checkbox layout width , height this:
android:layout_width="25dp" android:layout_height="25dp" android checkbox
Comments
Post a Comment