如果我针对gallery的每个item自定义一个adapter,会报出这样一个异常:ERROR/AndroidRuntime(397): java.lang.ClassCastException: android.widget.Gallery$LayoutParams cannot be cast to android.widget.LinearLayout$LayoutParams。而如果我自定义一个adapter中放入gallery及小图片等,当我gallery动的时候,小图片还在原先的位置没有移动。
可以自定义item的布局,在Adapter 中传入你自己定义的item的布局文件就ok了
如:
SimpleAdapter adapter = new SimpleAdapter(IphoneActivity.this, list_appinfos, R.layout.list_item_layout,
new String[]{"app_name","app_des"}, new int[] {R.id.app_name,R.id.app_desc});