erdomester
erdomester

Reputation: 11829

Custom radio button too large

Does anyone know how to scale down the custom radio buttons? The drawables are 200x200px large, but setting layout_width or width just makes only a part of the original image shown.

I could do it by creating different sizes for the four densities, but I don't think it's the right way to do it. There must be a way to scale it down! Or is it possible, there isn't?

 <RadioGroup
        android:id="@+id/rg"
        android:layout_width="wrap_content"
        android:layout_marginTop="10dp"
        android:layout_height="wrap_content" >

        <RadioButton
            android:id="@+id/radioButton1"
            android:width="30dp" 
            android:height="30dp"
            android:button="@drawable/rb_selector"
            android:text="Don't stop me now"
            />

        <RadioButton
            android:id="@+id/radioButton2"
            android:width="30dp"
            android:height="30dp"
            android:button="@drawable/rb_selector"
            android:text="I want to break free" />

        <RadioButton
            android:id="@+id/radioButton3"
            android:width="30dp"
            android:height="30dp"
            android:button="@drawable/rb_selector"
            android:text="Bohemian rhapshody" />


        <RadioButton
            android:id="@+id/radioButton4"
            android:width="30dp"
            android:height="30dp"
            android:button="@drawable/rb_selector"
            android:text="Another one bites the dust" />

</RadioGroup>

Upvotes: 0

Views: 883

Answers (1)

njzk2
njzk2

Reputation: 39406

android:button, android:checkmark and android:drawable_* are never scaled. The size use to display them depends on the density folder in which they are found.

Upvotes: 1

Related Questions