【发布时间】:2013-04-14 04:48:56
【问题描述】:
我是 android 新手,我只是在学习。 我想要一些关于如何在 android 的 ListView 中获取上标的帮助。 现在,我有一个 TextView 可以通过 标签使用 Html.fromHtml() 函数来获取例如23。 但是现在刚开始学习使用ListView,不知道具体怎么用,但是标签不起作用。
在 onCreate 我有这个:
...
// Create and populate a history list
String[] history = new String[] {};
ArrayList<String> historyList = new ArrayList<String>();
historyList.addAll(Arrays.asList(history));
// Create ArrayAdapter using the history list.
listAdapter = new ArrayAdapter<String>(this, R.layout.history_list, historyList);
// Set the ArrayAdapter as the ListView's adapter.
historyListView.setAdapter(listAdapter);
在 onClick/AsyncTask/onPostExecute 我有这个:
...
listAdapter.add(outputToHistory);
在 history_list.xml 我有这个:
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/textView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textIsSelectable="true" >
</TextView>
谢谢
【问题讨论】:
-
使用 [this][1] 技巧来使用来自字符串资源 [1] 的 html 标签:stackoverflow.com/a/22105902/1350021
标签: android html listview superscript