0
我已經做了一個應用程序,我在服裝gridview顯示數據,它的進展順利,但問題是,當我滾動它,併到底部並返回頂部,那麼所有項目的位置可以自動更改.and一段時間後它不會出現後scroll.here是我的代碼,我認爲有些事情錯getView
錯誤的gridview
@
Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
ViewHolder viewholder;
// LayoutInflater inflator = activit.getLayoutInflater();
if(convertView == null) { // recycled view is null so create it.
viewholder = new ViewHolder();
convertView = inflator.inflate(R.layout.griedviewrow, null);
viewholder.imgvGridItem = (RelativeLayout) convertView
.findViewById(R.id.rlGreidItemicon);
viewholder.txtGridItemlabel = (TextView) convertView
.findViewById(R.id.txtGridItemlabel);
if ((lstpinfo.get(position).appname.toString()) != null) {
viewholder.imgvGridItem.addView(getimageviewimage(lstpinfo
.get(position).icon));
viewholder.txtGridItemlabel
.setText(lstpinfo.get(position).appname.toString());
}
}
return convertView;
}