用例:
I am writing code for browser, in that I want to display WebView
content inside a PopupWindow. That is WebView should not be part of
MainApplication window.
详细信息:
弹出窗口布局详情如下
{
popUp = new PopupWindow(this);
layout = new LinearLayout(this);
mainLayout = new LinearLayout(this);
but = new Button(this);
but.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
popUp.showAtLocation(mainLayout, Gravity.CENTER, 10, 10);
popUp.update(0, 0, 1280, 1024);
}
}
flayout = new FrameLayout(this);
mwebview = new WebView(this);
flayout.addView(mwebview);
params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
layout.addView(flayout, params);
popUp.setContentView(layout);
mainLayout.addView(but, params);
setContentView(mainLayout);
=== webview init done here===
}
真的需要你的建议。