If your Gridview got a reverse order display bug after refresh the screen
try to change the code of Google sample to below code
try to change the code of Google sample to below code
public View getView(int position, View convertView, ViewGroup parent) { View v = convertView; if(convertView==null){ LayoutInflater li = getLayoutInflater(); v = li.inflate(R.layout.iconview, parent, false); } TextView tv = (TextView)v.findViewById(R.id.icon_text); tv.setText(fun_strs[position]); ImageView iv = (ImageView)v.findViewById(R.id.icon_image); iv.setImageResource(fun_imgs[position]); return v; }
沒有留言:
張貼留言