繁体   English   中英

坐在WebView之上的FrameLayout吗?

[英]Sit FrameLayout on top of WebView?

首先,我阅读了其他一些WebView问题,但似乎没有一个问题完全相同。

我有一个WebView和一个FrameLayout ,FrameLayOut看起来像..

 FrameLayout fl = new FrameLayout(this);
 EditText qbox = new EditText(this);
 box.setText(query);
 Button button = new Button(this);
 fl.addView(button, 45,45);
 fl.addView(box,275,45);

然后,我像这样将WebviewFrameLayout添加到我的LinearLayout

     LinearLayout ll = new LinearLayout(this);
     webview.loadUrl(url);
     ll.addView(fl,300,45);
     ll.addView(webview, LayoutParams.FILL_PARENT);

但是,这很奇怪。而不是FrameLayout显示在页面顶部的Webview的“顶部”,而Webview则在右侧(大多数是页面外),而屏幕的其余部分为黑色。 为什么?

默认情况下, LinearLayout是水平的。 如果希望LinearLayout垂直,请使用setOrientation(LinearLayout.VERTICAL)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM