[问题] 在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