0

enter image description here

Is there any way to give Space between radio Circle and left border. I'm tried to give margin but it's not working ,I also try to give padding but it increase space between text and button.

Radio xml Code:

<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <RadioGroup
            android:id="@+id/radioGroup1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <RadioButton
                android:id="@+id/chkIos"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/_12sdp"
                android:layout_marginLeft="@dimen/_12sdp"
                android:layout_marginEnd="@dimen/_5sdp"
                android:layout_marginRight="@dimen/_5sdp"
                android:layout_weight="1"
                android:background="@drawable/option_layout"
                android:button="@drawable/custom_checkbox"
                android:gravity="center"
                android:padding="@dimen/_12sdp"
                android:text="1211asd3"
                android:textColor="@color/black" />


            <RadioButton
                android:id="@+id/radio1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@drawable/option_layout"
                android:button="@drawable/custom_checkbox"
                android:layout_marginStart="@dimen/_42sdp"
                android:padding="@dimen/_12sdp"
                android:text="RadioButton2"
                android:layout_marginLeft="@dimen/_42sdp" />


            <!--<TextView-->
            <!--android:layout_weight="1"-->
            <!--android:layout_width="match_parent"-->
            <!--android:layout_height="wrap_content" />-->
        </RadioGroup>
    </LinearLayout>

Does anyone know how it can be Done?

AskNilesh
  • 67,701
  • 16
  • 123
  • 163
Rahul Bh
  • 123
  • 2
  • 15
  • 1
    check this https://stackoverflow.com/q/54394333/7666442 – AskNilesh Feb 01 '19 at 06:39
  • Hi @NileshRathod in your answer he is not given any drawable to button that's why there is space between button and left margin ... Thank you but it's not solve the problem – Rahul Bh Feb 01 '19 at 06:53
  • You need to add padding to your icon manually in your source images, default icons have some padding. – karan Feb 01 '19 at 07:04

1 Answers1

0

Instead of pasting your images directly to drawable folders, Try importing them from

File -> new -> Image Asset

It will show you following dialog where you need to select Icon type as Actionbar and Tab Icons and add padding using the padding control. Default icons have some padding in them try adding atleast 5% padding and change value if you need more space

enter image description here

karan
  • 8,637
  • 3
  • 41
  • 78