我可以通過XML解析在ListVew上設置圖像,但我無法在圖庫上設置圖像。請讓我知道如何做到這一點,任何指導或示例的鏈接可能會有所幫助。如何通過Android中的XML解析在圖庫上設置圖像?
0
A
回答
2
這個問題還沒有一個具體的答案。你必須使用很多東西。你只是搜索圖庫視圖和延遲適配器...
1
通過使用XML解析,解析所有的圖像網址。獲得所有圖像網址後,您可以使用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>
我認爲這將讓你期望的結果。
相關問題
- 1. Android圖庫問題通過xml設置圖像大小
- 2. 通過解析xml來設置ImageButton的圖像
- 3. 解析設置圖像javascript
- 4. 在Android中通過XML切換圖像
- 5. 如何通過URL在ImageView中設置圖像Android
- 6. 如何通過onclick將圖像放置在android中的另一個圖像上?
- 7. 解析Android通知:如何在Parse v1.1上設置小通知圖標?
- 8. 如何在Android上的Glide中設置位圖圖像
- 9. 如何通過css3設置3D圖像
- 10. 如何從圖像設置圖標(圖庫中的圖像)
- 11. 如何從XML頁面解析圖像
- 12. 如何在android中使用url圖像和文本解析XML並將其設置爲列表視圖
- 13. 如何在Android ImageView中設置圖像
- 14. 如何在Android中設置圖像
- 15. 在圖庫中設置圖像的位置android
- 16. 在UIIMageView上設置圖像,其中圖像名稱來自xml
- 17. 在imageview中設置圖庫的圖像
- 18. Android:如何:通過位圖設置ImageSwitcher的圖像? setImageBitmap不存在?
- 19. 如何將圖像上傳到解析在android中?
- 20. 解析XML - 恢復圖像
- 21. XML解析圖像OnClick
- 22. 在Android中的圖像按鈕上設置前景圖像
- 23. 如何設置android中的圖像
- 24. 如何在wpf中設置radtreeviewitem的圖像(通過Telerik)
- 25. 在Android上通過FTP上傳圖像
- 26. 如何在Android XML中將圖像置於其他圖像之上?
- 27. Android:如何通過XML中的按鈕更改背景圖像
- 28. 通過打開Opendialog框中的圖像在JLabel上設置圖像
- 29. 如何在android的webview中的imageview上設置圖像
- 30. 通過xml設置繪圖的alpha值
非常感謝。它運作良好! – user818992 2012-01-23 12:48:18
@ user818992如果我的答案幫助您解決了您的問題,請接受我的答案。 http://stackoverflow.com/faq#reputation – Basil 2012-01-24 04:57:10