显示WebView

kla*_*han 5 android

有没有人知道如何获得具有以下描述的视图:在页面顶部有一个自定义测试,下面显示了网址中的内容.目前我的布局如下:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="vertical"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
     >
    <TextView  
        android:id="@id+/test"
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
    />

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

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

在紧接着这个布局的应用程序的创建中,我使用findViewById获取TextView并为其设置文本.类似我得到WebView并为它调用loadUrl("url"),但行为不是预期的行为.首先简要显示文本集,然后显示带有来自传递的URL的内容的全屏浏览器页面.

syn*_*nic 5

添加android:layout_weight='1'到WebView.