Custom Checkbox changes its size when isChecked is true Android? -
I have an option with custom box defined by a Draybl made in Android Sset studio ExpandableListView.
For some reason, when the checkbox is checked, then it does not look small when it is not. I have already checked that if I made a mistake with the size of the images and they have the same size (disabled or enabled)
The code for my custom checkbox is here:
Dryable / custom_checkbox. Xml
& lt ;? Xml version = "1.0" encoding = "UTF-8" & gt; & Lt; Selector xmlns: Android = "http://schemas.android.com/apk/res/android" & gt; & Lt; Before Android: Drobl = "@ drawable / Aisi_suaiti_anested" Android: state_checked = "true" android: state_focused = "true" / & gt; & Lt; Before Android: Drobl = "@ drawable / Aisi_aksept_disibated" Android: Stet_cachd = "false" Android: Stet_foks = "true" / & gt; & Lt; Item Android: Dragon = "@ Draubable / IC_Except_Disbited" Android: state_checked = "false" /> & Lt; Item Android: Drawable = "@ Drauble / IC_SUIT_Enested" Android: state_checked = "true" /> & Lt; / Selector & gt;
My Drawables / ICISUVS_Applied & amp; Disabled:
Each element in ExpandableListView
& lt rows; XML version = "1.0" encoding = "UTF-8"? & Gt; & Lt; 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" & gt; & Lt; Android: layout_alignParentTop = "false" android: layout_centerVertical = "true" android: layout_toLeftOf = "@ + id / one_item_checkbox": Android: layout_height = "wrap_content" Android: layout_width = "wrap_content" android: id = "@ + id / title_one_item" "Android: layout_toRightOf =" @ + id / one_item_row_image "android: padding =" L0dp "Android: textAppearance =" android: attr / textAppearanceLarge "Android: textcolor ="? @ color / akdemia_0_black "/ & gt; & Lt; 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_coreon_iphone" / & gt; & Lt; Czech box 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: Focus =" false "/> & Lt; / RelativeLayout & gt;
And here is a screen shot of an extended listview, where you can see the problem: (ignore all orange rectangles where they have been added to the objective)
Hope anyone can help me with this, in advance Thanks!
Give your checkbox a width and height of the layout:
Android: layout_width = "25dp" Android: layout_heck = "25dp"
Comments
Post a Comment