Reputation: 386
In android xml how to underline the string with the spacing? If I using the underscore it will look not nicely because there are some gap between the underscore.
Example below are the underline that have gaps
Example below are the one that I looking for:
Upvotes: 0
Views: 256
Reputation: 123
Make drawable for underscore line and set between that views.
Or use like this
TextView tv = (TextView) findViewById(R.id.tv);
tv.setText(Html.fromHtml("Go<u> </u>Travel"));
The output is :
Go_______Travel
Upvotes: 1
Reputation: 25830
String temp = "Go Travel"
temp=temp.replaceAll(" ", "_"); // return Go______Travel
Note that it is just the simple logic, you can obviously use many other solutions based on your application/business logic.
Hope it helps.
Upvotes: 0