我是安卓新手。我有一段string如下所示
String my_paragraph ="Software is a set of instructions, data or programs used to operate computers and execute specific tasks. It is the opposite of hardware, which describes the physical aspects of a computer. Software is a generic term used to refer to applications, scripts and programs that run on a device."
textView.setText(my_paragraph);
Run Code Online (Sandbox Code Playgroud)
我想在文本视图中显示它,如下图所示:
但我得到的是我在下面添加的
我希望文本视图(段落)中的第一行应该从中间开始。我不想在string. 我不知道如何实现这一目标。请帮我解决一些问题。
小智 5
Android 拥有可以为您执行此操作的库。我找到了一篇关于如何使用SpannableString和LeadingMarginSpan库的旧帖子。
可以在以下位置找到问题:Android 中的领先利润率是多少?
尝试在开头添加\tor (制表符) - 这是段落默认缩进的符号\u0009String
textView.setText("\u0009" + my_paragraph);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
86 次 |
| 最近记录: |