2016-05-27 10 views

Antwort

0

Ersetzen Sie die LinearLayouts durch ListsViews. Die Idee ist, das zweite ListView in HorizontalScrollView zu platzieren.

<xml version="1.0" encoding="utf-8"?> 
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     xmlns:tools="http://schemas.android.com/tools" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:paddingBottom="@dimen/activity_vertical_margin" 
     android:paddingLeft="@dimen/activity_horizontal_margin" 
     android:paddingRight="@dimen/activity_horizontal_margin" 
     android:paddingTop="@dimen/activity_vertical_margin" 
     tools:context="com.idokov.layouttests.MainActivity"> 

     <LinearLayout 
      android:orientation="horizontal" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_alignParentTop="true" 
      android:layout_alignParentLeft="true" 
      android:layout_alignParentStart="true"> 

      <LinearLayout 
       android:orientation="vertical" 
       android:layout_width="wrap_content" 
       android:layout_height="match_parent" 
       android:layout_marginRight="5dp"> 
       <TextView 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="What is Lorem Ipsum?" /> 
      </LinearLayout> 


      <HorizontalScrollView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content"> 

       <LinearLayout 
        android:orientation="vertical" 
        android:layout_width="wrap_content" 
        android:layout_height="match_parent"> 

        <TextView 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:singleLine="true" 
         android:text="Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum." /> 
       </LinearLayout> 

      </HorizontalScrollView> 

     </LinearLayout> 
    </RelativeLayout> 
+0

Das Gleiche habe ich versucht. Aber es scrollt nur einzelne Zeilen. Ich muss den gesamten rechten Teil scrollen. Von der ersten Zeile bis zur letzten Zeile mit normalem Auf- und Ab-Listenansichts-Scroll. –

Verwandte Themen