【问题标题】:create webview on top of the other layouts which fits to screen在适合屏幕的其他布局之上创建 webview
【发布时间】:2014-06-19 13:42:33
【问题描述】:

我可以在所有其他布局之上动态创建一个 WebView 吗?

其实我想把 WebView 放在所有布局的顶部,哪个适合屏幕?

我正在使用LinearLayout。我可以使用代码做到这一点吗?

【问题讨论】:

  • 只需将 webview 添加到您的 xml 布局中的正确位置。然后在你的代码中你只需要设置可见性。

标签: android webview android-webview webviewclient


【解决方案1】:

创建一个FrameLayout 并将您的LinearLayout 和WebView 放入其中。 由于在FrameLayout 中,子视图被绘制在堆栈中。您将看到两个视图相互重叠。控制他们的可见性以在您的视图之间切换。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-09-15
    • 2017-07-05
    • 2013-04-18
    • 1970-01-01
    • 1970-01-01
    • 2010-12-11
    • 1970-01-01
    相关资源
    最近更新 更多