首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何在TextView中添加项目符号?

如何在TextView中添加项目符号?
EN

Stack Overflow用户
提问于 2010-08-07 15:22:51
回答 8查看 152K关注 0票数 182

我有一个TextView,我想通过XML在我的文本中添加一个项目符号。有可能吗?

EN

回答 8

Stack Overflow用户

回答已采纳

发布于 2010-08-07 15:56:18

您必须使用正确的character encoding来实现此效果。您可以尝试使用•

更新

为了清楚起见:使用setText("\u2022 Bullet");以编程方式添加项目符号。0x2022 = 8226

票数 412
EN

Stack Overflow用户

发布于 2013-07-30 07:59:07

这对我很有效:

代码语言:javascript
复制
<string name="text_with_bullet">Text with a \u2022</string>
票数 69
EN

Stack Overflow用户

发布于 2010-10-18 06:53:01

可能有一个更好的解决方案,但这就是我所做的。

代码语言:javascript
复制
<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>

它的工作方式如您所愿,但实际上是一种变通方法。

票数 18
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3429546

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档