2017-01-24 2 views
0

Ich habe ein Problem in Android Studio. Ich muss dieses Layout zum Scrollen machen, aber es scrollt nur sehr wenig.Scrollen nur durch sehr wenig

Was könnte das Problem sein?

Habe bis jetzt mehrere Lösungen ausprobiert, aber noch nichts funktioniert.

mit setNestedScrollingEnabled (false) funktioniert nicht, da ich älter API Bekämpfung bin

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" 
    android:layout_height="35dp" 
    android:orientation="vertical" 
    > 

    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical"> 
    <LinearLayout 
     android:layout_width="wrap_content" 
     android:layout_height="39dp" 
     android:orientation="horizontal"> 


     <one.triangle.me.element.TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_marginEnd="3dp" 
      android:layout_marginRight="3dp" 
      android:id="@+id/element_1" 
      android:textSize="26sp" 
      android:layout_gravity="center_vertical" 
      android:text="•" 
      /> 
    </LinearLayout> 

    <TextView 
     android:id="@+id/multi_item_selected" 
     android:layout_width="20dp" 
     android:layout_height="20dp" 
     android:layout_alignParentRight="true" 
     android:layout_alignParentEnd="true" 
     android:layout_centerVertical="true" 
     android:src="@drawable/whatever"/> 

    </RelativeLayout> 

</ScrollView> 
+4

Warum android: layout_height = "35dp" in Scroll – Rahul

+0

"mit setNestedScrollingEnabled (false) funktioniert nicht, da ich älter API Bekämpfung bin" - 'NestedScrollView' ist Teil der Support-Bibliothek und sollte daher mit älteren Geräten kompatibel sein. – PPartisan

+0

was sollte das Beste sein, stattdessen zu schreiben? – Kasparas

Antwort

0

entfernen height von Scroll, wie ihr Childs größere Höhe hat als übergeordnete Ansicht. Also entweder wrap_content oder match_parent.

+0

funktioniert immer noch die gleiche .. – Kasparas

+0

Ihr Inhalt ist sehr weniger, entweder Höhe der ScrollBar zu verlängern und zu testen und auch fillViewPort-Eigenschaft von ScrollView – Rahul

0

Aktualisieren Sie Ihre XML-Code wie folgt:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 
+0

versucht, dies noch vor der gleichen Bewegung von sehr wenig – Kasparas

+0

, aber Ihr Inhalt ist sehr klein ... –

Verwandte Themen