有人知道我如何获得以下描述的视图吗: 页面顶部是自定义文本,下面显示来自url的内容。目前我的布局如下:
<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>
在与此布局相关的应用程序的onCreate方法中,我使用findViewById获取TextView并设置其文本。同样地,我获取WebView并为其调用loadUrl("url")方法,但行为不是我们所期望的。首先,设置的文本会短暂地显示,然后会显示一个全屏浏览器页面,其中包含传递的URL的内容。