2012年4月26日 星期四

[Android] Custom ListView

介紹如何使用 ListView
ListView之一:Adapter介紹與使用

如何產生 separated header
Separating Lists with Headers in Android 0.9

當我們使用 custom background 時, 如果 scroll ListView
會發現出現黑色的背景, 這個問題的原因如下:

ListView 使用 transparent background, 但是在 scroll 時
會用 cache color hint 來當作背景以加速繪圖
詳細的說明在此 http://developer.android.com/resources/articles/listview-backgrounds.html

因此, 我們可以用 ListView::setColorHint() 或是 xml 來改變 scroll 時
會出現的背景色, 或設為 #00000000


沒有留言:

張貼留言

Python Tkinter First Example

import tkinter as tk def on_closing():     root.destroy() class MainWindow(tk.Tk):     def __init__(self, *args, **kwargs):         tk.Tk.__...