0
        <HorizontalScrollView
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:fillViewport="true">
            <ListView
                android:id="@+id/attackslist"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="#ffffff" />


    </HorizontalScrollView>

I put a ListView inside an HorizontalScrollView because its content is way too long to fit in the screen, but what i get is that the list looks like this (the background color is there to show where the list's childs stop)

while i want all the childs equally spaced in there until the end of the list, which i get if the ListView is not inside a scrollbar

My custom layout I use in the adapter looks like this

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="match_parent"
android:background="#ffffff"
android:layout_height="match_parent">

<TextView
    android:id="@+id/Moves"
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:layout_gravity="fill"
    android:layout_weight="1"
    android:gravity="center"
    android:text="Moves"
    android:textSize="14dp" />
<TextView
    android:id="@+id/Hitboxactive"
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:layout_gravity="fill"
    android:layout_weight="1"
    android:gravity="center"
    android:text="Hitbox Active"
    android:textSize="14dp" />
</LinearLayout>

How should I handle this situation? Can I change the values during runtime? Should I use a different View?

Thanks

0 Answers0