Android 使用滚动视图而不是在WebView中滚动
我有一个视图TextViews和一个WebView,我想将其作为一个单元来划船,而不是在需要时因为内容长度而滚动WebView。这可能很简单,但我似乎无法让它工作,因为WebView始终有一个滚动条 这是我的布局文件:Android 使用滚动视图而不是在WebView中滚动,android,android-layout,webview,scrollview,Android,Android Layout,Webview,Scrollview,我有一个视图TextViews和一个WebView,我想将其作为一个单元来划船,而不是在需要时因为内容长度而滚动WebView。这可能很简单,但我似乎无法让它工作,因为WebView始终有一个滚动条 这是我的布局文件: Webview有一个内部滚动条。因此,在另一个scrollview中包装它不是一个好的选择。我不知道你的HTML有多复杂,也不知道它在你的案例中是否是一种选择,但也许你应该考虑在这里讨论的纯文本视图中显示它:它基本上是HTML表单RSS提要,因此可以包含从图像到cs
Webview有一个内部滚动条。因此,在另一个scrollview中包装它不是一个好的选择。我不知道你的HTML有多复杂,也不知道它在你的案例中是否是一种选择,但也许你应该考虑在这里讨论的纯文本视图中显示它:它基本上是HTML表单RSS提要,因此可以包含从图像到css的所有内容。TextView不太合适,我想有点玩弄了。有没有办法知道WebView的高度,这样我就可以更新WebView框架的高度
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/imageView"
android:src="@drawable/background_tablet"
android:scaleType="centerCrop"
android:contentDescription="@string/background_image" />
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/list_background_overlay">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:background="@color/list_background_overlay"
android:baselineAligned="false">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/author"
android:id="@+id/article_view_author"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/title"
android:id="@+id/article_titleView" android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/site"
android:id="@+id/article_view_site"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/date_unknown"
android:id="@+id/article_view_date"
android:gravity="right"/>
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="70dp"
android:background="@color/list_background_overlay"
android:id="@+id/article_mediaLayout"
android:padding="10dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/duration_default"
android:id="@+id/article_duration"
android:gravity="left"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
/>
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/play"
android:id="@+id/article_playBttn"
android:layout_alignTop="@+id/article_preview"
android:layout_centerInParent="true"/>
<ImageView
android:layout_width="100dp"
android:layout_height="50dp"
android:id="@+id/article_preview"
android:layout_gravity="center"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:paddingRight="20dp"
android:contentDescription="@string/preview_image" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_marginLeft="512dp"
android:layout_alignParentTop="true"
android:layout_marginTop="10dp"
android:id="@+id/relativeLayout">
</RelativeLayout>
</RelativeLayout>
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="15dp"
android:id="@+id/article_filler">
</FrameLayout>
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/list_background_overlay"
android:paddingTop="20dp"
android:paddingBottom="20dp">
<WebView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/article_contentView" android:layout_gravity="center_horizontal"
android:padding="10dp"
android:paddingTop="30dp"
android:paddingBottom="20dp"/>
</FrameLayout>