【问题标题】:webview doesn't show up underneath button in android layoutwebview没有显示在android布局中的按钮下方
【发布时间】:2015-04-24 21:46:51
【问题描述】:

在我使用按钮和 webview 实现线性布局之前,我的独立 webview 运行良好。我添加了以下内容,现在只显示按钮:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="match_parent">

    <ImageButton
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:src="@drawable/back_nav"
     />

    <WebView  xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/webview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        />

</LinearLayout>

我只想要一个跨越顶部的按钮,在它下面有一个 webview 来填充视图的其余部分。

我做错了什么?

【问题讨论】:

    标签: android android-layout webview


    【解决方案1】:

    您的方向设置为水平,按钮设置为“fill_parent”,这意味着 webview 将来到按钮的右侧,填充整个屏幕,使 webview 出现在屏幕之外。

    要解决此问题,请将 LinearLayout 的方向设置为“垂直”。

    【讨论】:

      猜你喜欢
      • 2010-12-13
      • 1970-01-01
      • 1970-01-01
      • 2014-10-09
      • 1970-01-01
      • 2015-11-22
      • 1970-01-01
      • 2019-08-19
      • 1970-01-01
      相关资源
      最近更新 更多