相关疑难解决方法(0)

在Android TextView中,是否可以插入段落?

下面是我遇到的问题类型的示例.我有一个pojo中的数据,我需要在textview中显示...数据有伪代码,用[p]表示每个段落

我想以某种方式将[p]解析为文本视图中显示的段落.可以这样做吗?有什么东西我可以替代[p],它会在textview中创建一个新的段落吗?

Question question = new Question();
question.setText("Here is the first paragraph.[p] And this should be the second."); 

TextView view = (TextView) findViewById(R.id.qtext);
view.setText(question.getParsedText());
Run Code Online (Sandbox Code Playgroud)

android textview

11
推荐指数
2
解决办法
2万
查看次数

标签 统计

android ×1

textview ×1