Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to put space between switch button and its text in android?

I have the following element:

<Switch     android:text="Data about client?"     android:id="@+id/connected" /> 

But on designer the switch button and its text "Data about client?" are very glued together. I tried putting space between ? and " like that :

android:text="Data about client?    " 

But I don't like that type of solution very much

like image 790
Profile2ForStack Avatar asked Dec 22 '17 12:12

Profile2ForStack


1 Answers

I had the same issue, but for me the accepted answer of Sravan Sriram did not solve the problem.

What worked for me was the tag

android:switchPadding = "10dp" 

Minimum space between the switch and caption text. docs

like image 100
Periklis Vai Avatar answered Sep 29 '22 12:09

Periklis Vai