在片段的Andr​​oid的ListView [英] Android ListView in Fragment

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

问题描述

我想创建项目的列表,其中包含的图像和一些描述在每个单独的图像。在此之后,该名单将发生在片段在应用程序中。任何人都可以引导我创造的呢?我也不太清楚我怎么能做到这一点,而不 ListActivity

I am trying to create a list of items which contains an image and some description for the image in each individual. After which, the list will be place in a fragment inside the application. Can anyone guide me to create it? I am not too sure how can I do it without the ListActivity.

推荐答案

这似乎是你的片断应该继承 ListFragment (不ListActivity)。 onCreateView()从ListFragment将返回的ListView 你就可以填充。

It seems like your Fragment should subclass ListFragment (not ListActivity). onCreateView() from ListFragment will return a ListView you can then populate.

下面是从开发人员指南填充列表的详细信息:您好,ListView控件

Here's more information on populating lists from the developer guide: Hello, ListView

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

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