[問題] 在gridview 中使用arrayadapter無法捲動

作者: nesk (大棵)   2015-07-17 16:39:48
目前的問題是gridview 2跟gridview3再捲到最下面時 無法再捲動
造成後面的資料無法顯示 一開始用的是cursoradapter時 可以捲動
有試過換成baseadapter 無效 不知是否有哪位大大 能給我點線索
謝謝
gridview 2 adapter程式碼如下:
class myCursorsAdapter extends android.widget.ArrayAdapter {
int reSource;
Context context = null;
private LayoutInflater mInflater;
private ArrayList<Data> abc = null;
public myCursorsAdapter(Context context, int textViewResourceId,
ArrayList<Data> objects) {
super(context, textViewResourceId, objects);
// TODO Auto-generated constructor stub
reSource = textViewResourceId;
mInflater = (LayoutInflater)
context.getSystemService(context.LAYOUT_INFLATER_SERVICE);
abc = objects;
}
public View getView(int position, View convertView, ViewGroup parent) {
View view;
ViewHolder holder;
if (convertView == null) {
view = mInflater.inflate(reSource, parent, false);
holder = new ViewHolder();
holder.nameView = (TextView) view.findViewById(R.id.Name);
holder.phoneNum = (TextView) view.findViewById(R.id.Number);
holder.logoView = (ImageView) view.findViewById(R.id.Logo);
view.setTag(holder);
} else {
view = convertView;
holder = (ViewHolder) convertView.getTag();
}
ChannelData temp = abc.get(position);
holder.nameView.setText(temp.getChannelName());
holder.phoneNum.setText(Integer.toString(temp.getChannelNum()));
holder.logoView.setImageBitmap(temp.getChannelLogo());
Log.d("Theme", temp.toString());
return view;
}
@Override
public int getCount() {
return abc != null ? abc.size() : 0;
}
static class ViewHolder {
TextView nameView;
TextView phoneNum;
ImageView logoView;
}
}
xml如下:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ChannelAppRootLayout"
android:layout_width="1400dp"
android:layout_height="match_parent"
android:layout_marginLeft="0dp"
android:clipChildren="false"
android:clipToPadding="false" >
<!

Links booklink

Contact Us: admin [ a t ] ucptt.com