在Android中是否可以将WebView
仅放在屏幕的一部分?如果是这样,那么XML是做什么的?如果可能的话,我想创建一个可滚动的HTML表格,因为它可能包含大量的数据行。感谢您的任何信息。WebView在屏幕的一部分(不是整个屏幕)
<RelativeLayout 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:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<Button
android:id="@+id/startButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="21dp"
android:layout_marginTop="18dp"
android:onClick="startDataGathering"
android:text="Start" />
<Button
android:id="@+id/stopButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/startButton"
android:layout_alignBottom="@+id/startButton"
android:layout_alignParentRight="true"
android:layout_marginRight="32dp"
android:onClick="stopDataGathering"
android:text="Stop" />
<!-- want a webview here to cover rest of screen -->
</RelativeLayout>
检查这个问题http://stackoverflow.com/questions/3382188/how-to-set-webview-as-non-fullscreen – Tiago 2013-04-11 16:50:28
首先,你需要更具体的了解你正在尝试做的。屏幕的哪个部分需要“WebView”,以及多少?相对大小?静态大小?其次,你需要表现出一些努力,这不是一个代码商店... – 2013-04-11 16:51:15
什么是你试过/得到代码? – petey 2013-04-11 16:52:14