Сделать Listview (элемент имеет свойство weight) Горизонтально прокручиваемый - PullRequest
1 голос
/ 03 апреля 2019

Horizontal Scrollview можно использовать для просмотра списка, чтобы прокрутить обе стороны.

Но мой элемент списка:

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal" android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <TextView
        android:layout_width="0dp"
        android:layout_weight="1"
        android:layout_height="match_parent"
        android:id="@+id/textView87" />
     <TextView
        android:layout_width="0dp"
        android:layout_weight="1"
        android:layout_height="match_parent"
        android:id="@+id/textView88" />
     <TextView
        android:layout_width="0dp"
        android:layout_weight="1"
        android:layout_height="match_parent"
        android:id="@+id/textView89" />
     <TextView
        android:layout_width="0dp"
        android:layout_weight="1"
        android:layout_height="match_parent"
        android:id="@+id/textView90" />

</LinearLayout>

Что я хочу: рассмотрим первое текстовое представление. Во всех строках эта ширина просмотра текста должна быть одинаковой. (Одинаково для всех видов текста)

Есть в любом случае, чтобы сделать это. Пожалуйста, помогите мне !!!

1 Ответ

0 голосов
/ 03 апреля 2019

Попробуйте это

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="match_parent"
android:weightSum="4"
android:layout_height="wrap_content">
<TextView
    android:layout_width="0dp"
    android:layout_weight="1"
    android:layout_height="match_parent"
    android:id="@+id/textView87" />
 <TextView
    android:layout_width="0dp"
    android:layout_weight="1"
    android:layout_height="match_parent"
    android:id="@+id/textView88" />
 <TextView
    android:layout_width="0dp"
    android:layout_weight="1"
    android:layout_height="match_parent"
    android:id="@+id/textView89" />
 <TextView
    android:layout_width="0dp"
    android:layout_weight="1"
    android:layout_height="match_parent"
    android:id="@+id/textView90" />

...