0
我應該使用convertView還是在下面的方法中創建一個新的視圖?我應該使用convertView嗎?
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = inflater.inflate(R.layout.content, null);
return v;
}
或
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.content, null);
return convertView;
}
null檢查是必須的嗎? – Nfear
它不是強制性的,但強烈建議 – Blackbelt
我需要在支票外創建文字瀏覽? – Nfear