Add margin between a RadioButton and its label in Android?

后端 未结 18 1481
春和景丽
春和景丽 2020-12-02 10:43

Is it possible to add a little bit of space between a RadioButton and the label while still using Android\'s built-in components? By default the text looks a little scrunche

18条回答
  •  既然无缘
    2020-12-02 11:27

    i tried several ways and finished with this one working correctly on both emulator and devices:

        
    
    • android:background needs to be transparent as it seems on api10 there is a background with intrinsic paddings (not tried with other apis but the solution works on others too)
    • android:button needs to be null as paddings will not work correctly otherwise
    • android:drawableLeft needs to be specified instead of android:button
    • android:drawablePadding is the space that will be between your drawable and your text

提交回复
热议问题