android - 正确使用 twoLineListItem Android

标签 android listview

我是 android 开发的新手,正在尝试创建一个标题为粗体的列表
以及每个项目的较小描述。 就像这里显示的那样(抱歉还不能发布图片):
http://i.stack.imgur.com/UVqzq.png
这是我必须开始的 XML:

<LinearLayout android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TwoLineListItem android:layout_width="fill_parent"
android:layout_height="wrap_content" android:mode="twoLine">
<TextView android:textAppearance="?android:attr/textAppearanceLarge"
android:id="@android:id/text1" android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<TextView android:layout_below="@android:id/text1"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_alignLeft="@android:id/text1" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@android:id/text2" />
</TwoLineListItem>
</LinearLayout> 

有没有办法从另一个 xml 文件中的数组填充列表?如果不是,我将如何从 Java 代码填充这样的列表?就像我说的,我是开发新手,所以我可能还差得远。感谢您的任何输入!

最佳答案

关于android - 正确使用 twoLineListItem Android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4435645/

相关文章:

java - ListView Android 因运行时异常而崩溃

android - 为什么 TableRow 不在屏幕中央?

android - 如何使用 TextWatcher 删除 EditText 中的文本?每次它检测到一个字符串并格式化它

java - 带有 HashMap 的 ListView 只显示一个数据

android - 在 listview 中呈现 webview 有烦人的行为

android - 折叠 CardView 动画无法正常工作

android - NoClassDefFoundError 使用 Android 应用程序、Maven 和 Eclipse 开发库

android - GridView 的 CollapsingToolbarLayout 问题

android - 更改切换按钮颜色

android - Listview onitem点击数据进入arraylist