如何将项目符号列表添加到我的文本视图?
发布于 2011-05-05 09:36:25
因为不支持ul/li/ol,所以很难做到。幸运的是,您可以将其用作语法糖:
• foo<br/>
• bar<br/>
• baz<br/>
•
是列表项目符号的html实体此处有更多选择http://www.elizabethcastro.com/html/extras/entities.html
更多关于马克·墨菲(@CommonsWare)支持哪些标签的信息,请使用Html.fromHtml加载http://commonsware.com/blog/Android/2010/05/26/html-tags-supported-by-textview.html
((TextView)findViewById(R.id.my_text_view)).setText(Html.fromHtml(myHtmlString));
发布于 2016-04-12 15:06:55
这是到目前为止最简单的..
<string name="bullet_ed_list">\n\u2022 He has been Chairman of CFL Manufacturers Committee of ELCOMA, the All India Association of Lighting Equipment Manufacturers.
\n\u2022 He has been the President of Federation of Industries of India (FII).</string>
发布于 2011-05-11 00:20:23
我使用的一个选项是使用样式设置可绘制的项目符号。
<style name="Text.Bullet">
<item name="android:background">@drawable/bullet</item>
<item name="android:paddingLeft">10dp</item>
</style>
用法:
<TextView android:id="@+id/tx_hdr"
android:text="Item 1" style="@style/Text.Bullet" />
https://stackoverflow.com/questions/4992794
复制相似问题