Размах Обновить макет и веб-вид в ScrollView - PullRequest
0 голосов
/ 29 сентября 2018

У меня есть текст заголовка и веб-представление в LinearLayout в ScrollView.Я хочу добавить макет обновления смахивания, но не знаю, где его разместить, потому что я всегда получаю ошибки или страница не отображается.

<?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="wrap_content">


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

            <TextView
                style="@style/PageTitle"
                android:text="@string/news_in_fazekas" />

            <WebView
                android:id="@+id/newsWebView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

    </LinearLayout>

</ScrollView>

1 Ответ

0 голосов
/ 29 сентября 2018

Попробуйте, надеюсь, это сработает для вас.

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/swiperefresh"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fillViewport="true">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <TextView
                style="@style/PageTitle"
                android:text="@string/news_in_fazekasx" />
            <WebView
                android:id="@+id/newsWebView"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />

        </LinearLayout>

    </ScrollView>

</android.support.v4.widget.SwipeRefreshLayout>
...