У меня есть горизонтальный список многострочных строк, и я хочу заблокировать гравитацию элементов, чтобы на экране можно было видеть только один элемент за раз.
Я попробовал Гравитация вариант, но положение элемента по-прежнему плавно.
Вот мой код:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="1dp"
android:scrollbarStyle="outsideOverlay"
android:fillViewport="true"
android:gravity="center_horizontal">
<android.support.v7.widget.CardView
android:layout_width="580dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center">
<TextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="350px"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_marginStart="0dp"
android:layout_marginTop="0dp"
android:layout_marginEnd="0dp"
android:autoSizeMaxTextSize="20dp"
android:autoSizeMinTextSize="8dp"
android:fadeScrollbars="false"
android:gravity="center"
android:nestedScrollingEnabled="true"
android:textSize="20dp"
android:background="@drawable/shape"
android:text="some text, can be multiline" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</ScrollView>