How to align Radio button at the center of the screen

前端 未结 11 1327
误落风尘
误落风尘 2021-01-04 02:13

I am using Radio buttons as tab in my application.

I have loaded images for it, but they are aligning towards left side. how to make them align at center.

11条回答
  •  执念已碎
    2021-01-04 02:49

    I tried all of the above and it doesn't work.

    I had found a better solution which i would like to share. Set your button to @null ; then add the drawable to android:drawableTop or any other type of position. This will enable us to set the drawables to other position of the radioButton. add some padding or drawablePaddingso that it will not stick to any side of the button/text.

    android:background="@drawable/background_paint"
    android:drawableTop="@drawable/shape"
    android:button="@null"
    

提交回复
热议问题