How to add many spaces after the text in TextView
By transforming Text as Html,you can solve that problem
this is one way to solve that :
message.setText(Html.fromHtml((myString + " "));
How do I give space in between text in textview?
We can use it.
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="A B C"/>
How to increase the spacing between paragraphs in a textview
You can use Spannable's to achieve this:
String formattedText = text.replaceAll("\n", "\n\n");
SpannableString spannableString = new SpannableString(formattedText);
Matcher matcher = Pattern.compile("\n\n").matcher(formattedText);
while (matcher.find()) {
spannableString.setSpan(new AbsoluteSizeSpan(25, true), matcher.start() + 1, matcher.end(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
The code above replaces all line breaks with two line breaks. After that it sets absolute size for each second line break.
Android TextView padding between lines
You can use lineSpacingExtra
and lineSpacingMultiplier
in your XML file.
additonal line space in textview
Definitely, Its device specific issue.
For better output in all devices you should use ScrollView
as a container of your TextView
.
In addition, If you want to add some extra space
between text lines
then you can use textView.setLineSpacing()
programmatically or from XML
you can use attribute android:lineSpacingMultiplier="1.3"
to TextView
for extra spacing.
Hope this will help~
How to change letter spacing in a Textview?
check out android:textScaleX
Depending on how much spacing you need, this might help. That's the only thing remotely related to letter-spacing in the TextView.
Edit: please see @JerabekJakub's response below for an updated, better method to do this starting with api 21 (Lollipop)
Related Topics
Socket.Io Client Getting Connected Disconnected Repeatedly
How to Change Background Color of Layout of List-View Item Using Array-Adapter
Apk Signing Error:Failed to Read Key from Keystore
Retrieve Stored Image from Firebase Storage
Android Kill Previous Activities Without a New Intent
How to Change the Background Color of the Options Menu
How to Remove Background Resource of Button
Android Studio Inline Compiler Showing Red Errors, But Compilation With Gradle Works Fine
How to Show Only Specific Part of Website in Android Webview
How to Edit Files Inside the Android Adb Shell
How Capture/Log API Calls (Function Calls) Made by Android App
How to Execute Adb Commands Through My Android App
How to Get the Json Response of a Post Request in a Webview
Getting Net::Err_Connection_Refused (Http://Localhost:8080) on Android 4.4.2 Version
How to Set Space Between Listview Items in Android
Notification Disappears After Showing