android - 我如何放置两个 WebView (一个位于另一个 WebView 之上)

标签 android eclipse webview

我正在尝试使用两个 WebView 进行布局。我的问题是当我想将一个 WebView 放在另一个 WebView 之上时。他们被置于不同的位置。感谢您!! ;)

我在这里写下我的代码:

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


     <WebView
         android:id="@+id/webview2"
         android:layout_width="match_parent"
         android:layout_height="50dp"
         android:autoLink="web"
         android:scrollbars="none"
         android:textColor="@android:color/black" />


<WebView
    android:id="@+id/webview1"
    android:layout_width="match_parent"
    android:layout_height="570dp"
    android:autoLink="web"
    android:scrollbars="none"
    android:textColor="@android:color/black" />

 </LinearLayout>

最佳答案

<?xml version="1.0" encoding="utf-8"?> 
 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
>


     <WebView
         android:id="@+id/webview2"
         android:layout_width="match_parent"
         android:layout_height="50dp"
         android:autoLink="web"
         android:scrollbars="none"
         android:textColor="@android:color/black" />


<WebView
    android:id="@+id/webview1"
    android:layout_width="match_parent"
    android:layout_height="570dp"
    android:autoLink="web"
    android:scrollbars="none"
    android:textColor="@android:color/black" />

 </FrameLayout>

关于android - 我如何放置两个 WebView (一个位于另一个 WebView 之上),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10311594/

相关文章:

Android 短信收件箱未读计数问题

android - OpenGL ES 2.0 中具有不同纹理坐标的两个纹理

Android Paging 3 库 : how to change list with new param?

java - Eclipse 3.6 在自动完成/快速修复时卡住

Eclipse 颜色主题 - 在 jsp 编辑器中难以阅读 javascript

Android google places API 超出每日配额

java - 错误未解决

android - 强制以横向、最大模式渲染,锁定宽高比,使所有内容都适合屏幕

android - 使用 webview 播放 youtube 视频时出现问题

javascript - Chrome App API 中 webview 标签的分区属性是什么?