0

我是为 Android 编写应用程序的初学者。

我需要一个“ImageSwitcher”并用来自服务器队列的图像填充它。在来问之前,我已经在互联网上进行了很多研究。有人会发布一些代码示例或给出一些关于搜索内容的提示吗?

4

1 回答 1

0

你想要做什么 创建这样的视图

<?xml version="1.0" encoding="utf-8"?>  
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
 android:orientation="vertical"  
 android:layout_width="fill_parent"  
 android:layout_height="fill_parent">  

  <Gallery  
       android:id="@+id/gallery"  
       android:layout_width="fill_parent"  
       android:layout_height="wrap_content" />  

  <ImageSwitcher  
       android:id="@+id/image_switcher"  
       android:layout_width="fill_parent"  
       android:layout_height="fill_parent" />  
</LinearLayout>

然后,在某种 AsyncTask 的幕后,下载图像,然后显示它们。该代码并不太难。

github上的这个项目也可能有用。在列表视图中延迟加载图像似乎很好,但我敢打赌它可以很容易地修改为加载画廊。

于 2012-07-17T17:11:35.043 回答