8
ViewHolder模式改善的ListView滾動幀率,如下面的例子中看出: https://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.htmlAndroid:ViewHolder模式和不同類型的行?
是否可以同時使用不同種類的瀏覽次數爲不同的行,以保持這種模式?
換句話說,是否有可能做這樣的事情:
public View getView(int position, View view, ViewGroup parent) {
// calculate viewID here
if (view == null || *view is not null but was created from different XML than viewID*) {
view = mInflater.inflate(viewId, null);
有沒有類似的技巧ExpandableListAdapter? – tomash
與此同時,我添加了需要的信息作爲標誌ViewHolder,它的工作原理 – tomash