【问题标题】:Can I make the webview take only a part of the screen?我可以让 webview 只占据屏幕的一部分吗?
【发布时间】:2010-04-09 21:43:14
【问题描述】:

我正在尝试在应用程序底部打开一个 webview 以显示少量信息,但它会不断占据整个屏幕并用信息覆盖其他小部件。 有没有办法让它在应用程序中具有一定的大小和位置?

【问题讨论】:

  • 向我们展示一些 XML 视图定义

标签: android webview


【解决方案1】:

哦,您应该提供一些布局 xml,以便我们可以看到您将 webview 包装在里面的内容。您的 webview 是您的应用程序布局的根元素吗 - 它将始终使用全屏。但是尝试将它包装在框架布局或其他东西中......

<FrameLayout
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:gravity="bottom">
  <WebView
  android:layout_height="100dp"
  android:layout_width="fill_parent"/>
</FrameLayout>

【讨论】:

    猜你喜欢
    • 2013-08-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-14
    • 2017-03-26
    • 2020-04-30
    • 1970-01-01
    相关资源
    最近更新 更多