首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

webview 如何实现window.open 创建新窗口的

2013-07-04 
webview 怎么实现window.open 创建新窗口的android 怎么实现window.open和自带浏览器一样的效果,就是在原

webview 怎么实现window.open 创建新窗口的
android 怎么实现window.open和自带浏览器一样的效果,就是在原有的webview上新建一个webview,但不是全屏,右上角有个关闭按钮!表达能力不好,效果图如下:webview 如何实现window.open 创建新窗口的 WebView Android window.open js 新窗口
[解决办法]


public class TutorialView extends RelativeLayout {

    private View baseView;

    public TutorialView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        mContext = context;
    }

    public TutorialView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
        mContext = context;
    }

    public TutorialView(Context context) {
        this(context, null);
        mContext = context;
    }

    public TutorialView(Context context, int step) {
        this(context);
        this.step = step;
        mContext = context;
        init();
    }

    private void init() {
        baseView = LayoutInflater.from(mContext).inflate(
                R.layout.my_relative_view, this);
    }
}


这样就可以了。具体的逻辑你可以写到init里,比如webView的内容啊,closebutton的监听啊。或者加一些其他的方法。

热点排行