读书人

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

发布时间: 2013-07-04 11:45:32 作者: rapoo

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的监听啊。或者加一些其他的方法。

读书人网 >Android

热点推荐