我想要一个展览馆,它的项目是webview。所以我不想要滚动图像,我想滚动want视图..请帮帮忙。我做了一些东西,但webview不能正确地进入画廊。
发布于 2011-08-24 17:57:13
您必须为您的图库视图使用自定义适配器,然后覆盖getView方法。如下所示:
public class CustomGalleryAdapter extends BaseAdapter然后
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
View view = convertView;
if (view == null)
{
LayoutInflater vi = (LayoutInflater)activity.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
view = vi.inflate(R.layout.YOUR_WEBVIEW_LAYOUT, null);
}
// Here do some changes to webview view
// view.SetXY()...
return view;
}并使用新适配器配置您的图库视图:
gallery.setAdapter(new CustomGalleryAdapter(...));YOUR_WEBVIEW_LAYOUT是在布局资源中创建的布局,它也可以只包含单个webview。
https://stackoverflow.com/questions/7173463
复制相似问题