在片段的Andr​​oid的ListView片段、Andr、ListView、oid

2023-09-13 00:43:51 作者:梦醒心亦碎

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