ros*_*man 3 android android-cursoradapter
我读了这个问题,它说不要担心,但我想我需要一些保证.
我的自定义CursorAdapter的bindView:
@Override
public void bindView(View view, Context context, Cursor c) {
// get handles for views in xml
ImageView imageView = (ImageView)view.findViewById(R.id.add_lvrow_image);
TextView titleView = (TextView)view.findViewById(R.id.add_lvrow_title);
// get data from cursor and "massage" if necessary
String imageUri = c.getString(c.getColumnIndex(CollectionsTable.COL_IMAGEURI));
String title = c.getString(c.getColumnIndex(CollectionsTable.COL_TITLE));
// terrible time getting run-time sizes of imageView, hardcode for now
int XML_WIDTH = 100;
int XML_HEIGHT = 100;
Log.d(TAG, SCOPE + "bindView called: " +count);
count++;
// use static util class
ImageUtils.loadBitmap(context, imageUri, imageView, XML_WIDTH, XML_HEIGHT);
Run Code Online (Sandbox Code Playgroud)
我正在关注的一系列的Android教程装载大的位图,但已经转移decodSmapledBitmapFromUri,calculateInSmapleSize,loadBitmap,BitmapWorkerTask,AsyncDrawable,cancelPotentialWork,和getBitmapWorkerTask到公共文件夹.
...所以我正在调用loadBitmap它的链接77次,其中列表视图当前有12行(在加载时显示6个屏幕,只显示第7个显示).
所以我不应该担心,这是可以的(对bindView的这些调用以及所有后续方法的触发)?
谢谢你的话.
如果在你的listview xml android:layout_height不是"match_parent"改为 android:layout_height="match_parent"
| 归档时间: |
|
| 查看次数: |
1796 次 |
| 最近记录: |