【发布时间】:2021-06-21 22:34:03
【问题描述】:
我是 Android 新手。我在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);
我想在文本视图中显示它,如下图所示:
但我得到的是我在下面添加的
我希望文本视图(段落)中的第一行应该从中间开始。我不想在string 中添加前导空格。我不知道如何实现这一点。请帮我解决一些问题。
【问题讨论】:
-
为什么要从中间开始?这可能会给我们提供解决方案的线索
-
@ariefbayu 真的有理由吗?这可能只是设计要求或 OP 必须实现的目标
-
@ariefbayu,感谢您的回复。我想在我的应用程序中显示一些带有答案的问题。所以对于答案文本视图,我希望它从中间开始。
-
因为就目前而言,除了在字符串前面加上一堆空白之外,我没有看到其他方法......