Вопрос прокрутки в Android - PullRequest
0 голосов
/ 11 августа 2011

В моем приложении у меня есть действие, которое имеет следующий макет

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="fill_parent"
    android:layout_height="fill_parent" android:background="@color/white">
    <WebView android:id="@+id/detail_title" android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceMedium"
        android:padding="2dp" android:textColor="@android:color/black"
        android:background="@android:color/white" />
    <WebView android:id="@+id/detail_subtitle" android:orientation="vertical"
        android:layout_width="match_parent" android:layout_height="wrap_content"
        android:padding="2dp" android:background="@android:color/white" />
    <WebView android:id="@+id/wv3" android:orientation="vertical"
        android:layout_height="fill_parent" android:layout_width="fill_parent" 
        android:background="@android:color/white" />
</LinearLayout>

wv3 имеет много HTML-текста, который отображается правильно, но проблема в том, что я получаю прокрутку только в wv3, а остальныемакет остается статичным, что довольно раздражает.Я хочу, чтобы весь макет имел прокрутку, а не только wv3.

1 Ответ

2 голосов
/ 11 августа 2011

Модифицируйте свой макет, как это

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"        
    android:layout_width="match_parent" android:layout_height="match_parent">
    <LinearLayout android:orientation="vertical" android:layout_width="match_parent"         
        android:layout_height="wrap_content">
        <WebView android:layout_width="match_parent" android:layout_height="200dip"
            android:id="@+id/wv1"/>
        <WebView android:layout_width="match_parent" android:layout_height="200dip"
            android:id="@+id/wv2"/>
        <WebView android:layout_width="match_parent" android:layout_height="500dip"
            android:id="@+id/wv3"/>    
    </LinearLayout>
</ScrollView>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...