正确使用twoLineListItem的Andr​​oid [英] Proper usage of twoLineListItem Android

查看:93
本文介绍了正确使用twoLineListItem的Andr​​oid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的开发在Android和试图创建具有一个大胆的标题
名单 并为每个项目较小描述。 这里所示(抱歉无法张贴图片还)之一:
http://i.stack.imgur.com/UVqzq.png
这是我要开始使用XML:

I am new to development on android and trying to create a list that has a bold header
and a smaller description for each item. Like the one shown here (sorry can't post images yet):
http://i.stack.imgur.com/UVqzq.png
This is the XML that I have to start with:

<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 code?就像我说我是新来的发展,所以我可能路要走。感谢您的任何输入!

Is there a way to populate the list from an array in another xml file? If not how would I populate a list like this from the Java code? Like I said I'm new to development, so I'm probably way off. Thanks for any input!

推荐答案

您使用列表视图的 http://developer.android.com/reference/android/widget/ListView.html

这篇关于正确使用twoLineListItem的Andr​​oid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆