Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/214.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何放大画廊?_Android - Fatal编程技术网

Android 如何放大画廊?

Android 如何放大画廊?,android,Android,我有一个带有自定义网页视图的图库。我的适配器: public class AddImgAdp extends BaseAdapter { int GalItemBg; private Context cont; public AddImgAdp(Context c) { cont = c; TypedArray typArray = obtainStyledAttributes(R.styleable.GalleryTheme);

我有一个带有自定义网页视图的图库。我的适配器:

public class AddImgAdp extends BaseAdapter {
    int GalItemBg;
    private Context cont;

    public AddImgAdp(Context c) {
        cont = c;
        TypedArray typArray = obtainStyledAttributes(R.styleable.GalleryTheme);
        GalItemBg = typArray.getResourceId(R.styleable.GalleryTheme_android_galleryItemBackground, 0);
        typArray.recycle();
    }

    public int getCount() {
        return pagesArray.length;
    }

    public Object getItem(int position) {
        return pagesArray[position];
    }

    public long getItemId(int position) {
        return position;
    }

    public View getView(int position, View convertView, ViewGroup parent) {

        final WebView wView = pagesArray[position];
        if(wView!=null){
            if(wView.loaded==0){
                wView.setInitialScale(50);
                wView.getSettings().setJavaScriptEnabled(true);
                wView.getSettings().setSupportZoom(false);
                wView.getSettings().setBuiltInZoomControls(false);
                wView.getSettings().setUseWideViewPort(true);
                wView.setPadding(0, 0, 0, 0);

                wView.setWebViewClient(new WebViewClient() {
                    @Override
                    public void onReceivedError(WebView view, int errorCode, String description, String failingUrl){
                        super.onReceivedError(view, errorCode, description, failingUrl);
                    }

                    @Override
                    public boolean shouldOverrideUrlLoading(WebView view, String url){
                        view.loadUrl(url);
                        return true;
                    }

                    @Override
                    public void onPageFinished(WebView view, String url){
                        wView.loaded = 1;
                    }

                });

                wView.loadUrl(URL_TO_LOAD);
                wView.setBackgroundResource(GalItemBg);
                Gallery.LayoutParams params = new Gallery.LayoutParams(400, 430);
                wView.setLayoutParams(params);
            }
        }
        return wView;

    }

}

还有,如何实现画廊的放大,使整个画廊都能增加/减少?

没有任何功能允许您使用imageview或gallery进行放大

但是这里有一个很好的教程,可以帮助你上路


我已经尝试过viewflipper,你为什么不这样尝试呢。我已经将代码粘贴到这里了。

我在[here][1]上发布了一个示例代码链接,希望能对[1]有所帮助: