Как прокрутить просмотрщик с помощью Image или ImageSlider - PullRequest
0 голосов
/ 12 ноября 2018

Пожалуйста, помогите мне. Я не могу прокрутить изображение с помощью утилиты XML:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="match_parent"
    android:background="@drawable/pattern"
    android:orientation="vertical"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context=".MainActivity"
    tools:showIn="@layout/app_bar_main">

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:src="@drawable/line" />

    <android.support.v4.widget.SwipeRefreshLayout
        android:id="@+id/main_swipe"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <android.support.v7.widget.RecyclerView
            android:id="@+id/rc"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </android.support.v4.widget.SwipeRefreshLayout>


</LinearLayout>

// Есть небольшая проблема с ImageView
// ScrollView, но не работает.

1 Ответ

0 голосов
/ 12 ноября 2018

Вы можете использовать вес макета linearlayout:

 <android.support.v4.widget.SwipeRefreshLayout
        android:id="@+id/main_swipe"
        android:layout_width="match_parent"
        android:layout_height="0dp"    
        android:layout_weight="1"
        >

        <android.support.v7.widget.RecyclerView
            android:id="@+id/rc"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            xmlns:tools="http://schemas.android.com/tools"                
            />
    </android.support.v4.widget.SwipeRefreshLayout>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...