我有一个TextView,我想通过XML在我的文本中添加一个项目符号。有可能吗?
发布于 2010-08-07 15:56:18
您必须使用正确的character encoding来实现此效果。您可以尝试使用•
更新
为了清楚起见:使用setText("\u2022 Bullet");
以编程方式添加项目符号。0x2022 = 8226
发布于 2013-07-30 07:59:07
这对我很有效:
<string name="text_with_bullet">Text with a \u2022</string>
发布于 2010-10-18 06:53:01
可能有一个更好的解决方案,但这就是我所做的。
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<TableRow>
<TextView
android:layout_column="1"
android:text="•"></TextView>
<TextView
android:layout_column="2"
android:layout_width="wrap_content"
android:text="First line"></TextView>
</TableRow>
<TableRow>
<TextView
android:layout_column="1"
android:text="•"></TextView>
<TextView
android:layout_column="2"
android:layout_width="wrap_content"
android:text="Second line"></TextView>
</TableRow>
</TableLayout>
它的工作方式如您所愿,但实际上是一种变通方法。
https://stackoverflow.com/questions/3429546
复制相似问题