Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change the size or the color of my spinner checkbox?

I'm working on an Android Project which allow the user to select a list of item in an Alert Dialog (see the image below).

enter image description here

I'm using android.widget.spinner. But the checkbox aren't well visible.

I'm trying to personalize the checkbox because this kind are by default.

So is it possible to replace them by my own checkbox?

like image 975
13KZ Avatar asked Nov 04 '22 08:11

13KZ


1 Answers

Try out this way in your layout file.

main.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearlayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/border" <--- android built-in style. You can define your own whichever you like. Check for it.
android:orientation="horizontal" >
<CheckBox
    android:id="@+id/check"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="2dp" />
<TextView
    android:id="@+id/Textname"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="7dp"
    android:textColor="#FAFAFA"
    android:textSize="14dp"
    android:textStyle="bold" />
</LinearLayout>
like image 194
GrIsHu Avatar answered Nov 15 '22 00:11

GrIsHu