2011-12-08 125 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> 

我認爲這將讓你期望的結果。

相關問題