我很惊讶,似乎没有这个问题。我的意思是,项目符号列表在关于对话框,常见问题解答等方面并不常见,并且子弹不必包含太多文本以跨越多行并遇到此问题。
不管怎样,我得解决它像这样现在:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:id="@+id/ScrollViewTipsLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/TipsLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TableLayout
android:layout_height="wrap_content"
android:id="@+id/TableLayout01"
android:layout_width="wrap_content"
>
<TableRow>
<TextView android:id="@+id/tvIngress"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@+string/tv_picking_content_ingress"
android:layout_span="2"
android:singleLine="false"
android:layout_weight="1"
/>
</TableRow>
<TableRow>
<TextView android:id="@+id/tvCleaningDot1"
android:layout_height="wrap_content"
android:text="•"
android:singleLine="false"
/>
<TextView android:id="@+id/tvCleaningFirst"
android:layout_height="wrap_content"
android:text="@+string/tv_picking_content_first"
android:layout_width="0dp"
android:layout_weight="1"
android:gravity="left"
android:singleLine="false"
/>
</TableRow>
<TextView android:id="@+id/tvCleaningDot2"
android:layout_height="wrap_content"
android:text="•"
android:singleLine="false"
/>
<TextView android:id="@+id/tvCleaningSecond"
android:layout_height="wrap_content"
android:text="@+string/tv_picking_content_second"
android:layout_width="0dp"
android:layout_weight="1"
android:gravity="left"
android:singleLine="false"
/>
</TableRow>
</TableLayout>
</RelativeLayout>
我用它来展示项目符号列表中的静态文本,所以我也懒得去创建项目符号+文本动态地在代码中。如果任何人有任何建议如何以更好的方式完成同样的事情,请让我高兴。
顺便说一句,如果与解决方案会建议在第二个以上链接:
android:text="<ol><li>item 1\n</li><li>item 2\n</li></ol>
在子弹的第二,第三等一行跨越多行不会得到相同的缩进作为一线,这很丑陋。
此问题已被要求。可能的重复http://stackoverflow.com/questions/3429546/android-how-to-add-bullet-symbol-in-textview http://stackoverflow.com/questions/2196499/ordered-lists-inside-an- android-textview – DeRagan 2010-09-15 10:07:19
@DeRagan,我不认为这是重复的。你提到的问题是要求有一个子弹符号,而不是一个项目符号列表。 – 2011-10-08 12:31:53