2011-12-08 126 views

回答

1

这是可能的。首先,您需要获取保存在远程服务器中的图像URL。这可以通过使用JSON或任何其他模式的api调用来实现。通过该api,您可以检索保存在远程数据库上的图像URL。获得所有图像网址后,您可以使用Lazy load of images in ListView加载图像。在惰性加载代码,他们已经用在布局一个ListView,因此图像和相应的文字显示为列表项,您可以在ListView控件更改为画廊是这样的:

<?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" /> 
     <Button 
      android:id="@+id/button1" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:text="Clear Cache"/> 
    </LinearLayout> 

我认为这将让你期望的结果。

相关问题