【问题标题】:Not able to display my webiew to full height inside dialog in android无法在android中的对话框内将我的webiew显示为全高
【发布时间】:2015-02-09 14:08:25
【问题描述】:

我想在对话框 android 中显示 webview,但我看不到它的内容。我附上了它的截图。我还在下面添加了它的代码。请告诉我如何解决它,使其占据整个对话框。

    <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#e4e4e4"
    android:orientation="vertical" >

    <FrameLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="5dp"
            android:text="@string/title_text_Contact_Info" />

        <ImageView
            android:id="@+id/imageView_close"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="top|right"
            android:clickable="true"
            android:src="@drawable/aa" />
    </FrameLayout>

    <View
        android:layout_width="fill_parent"
        android:layout_height="1dp"
        android:layout_marginLeft="3dp"
        android:layout_marginRight="3dp"
        android:background="@android:color/white" />

    <WebView
        android:id="@+id/webview1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" />

</LinearLayout>

【问题讨论】:

    标签: android xml webview fullscreen


    【解决方案1】:

    尝试将您的 WebView 包装到这样的容器中

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent" >
    
        <WebView
            android:id="@+id/webview1"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" />
    
    </FrameLayout>
    

    【讨论】:

      猜你喜欢
      • 2015-07-25
      • 2012-05-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-21
      • 1970-01-01
      相关资源
      最近更新 更多