2015-01-26 3 views
0

레이아웃 상단에는 textview, button 및 imageview..etc 요소가 있지만 부분에는 목록보기가 있습니다. 우리가 스크롤 할 때 최상위 요소는 listview에서도 스크롤해야합니다. 상대적 레이아웃과 scrollview android의 listview

하지만 너무

<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/com.revolage.vkcommunity" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="@color/vk_white" 
android:orientation="vertical" 
tools:context="com.egay.borsh.fragments.MainActivity" > 

<RelativeLayout 
    style="@style/ActionBarStyle" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:paddingBottom="@dimen/activity_vertical_margin" > 

    <RelativeLayout 
     android:id="@+id/action_bar_relative_layout" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:paddingBottom="@dimen/activity_vertical_margin" > 

     ...... 
    </RelativeLayout> 

    <com.costum.android.widget.PullAndLoadListView 
     android:id="@+id/main_post_list" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/header_linear_layout" /> 
</RelativeLayout> 

, 아무것도 스크롤되지 않습니다.

+0

'ListView'에 이미 스크롤 메카니즘이 있으므로'ListView'를'ScrollView' 안에 두지 마십시오. –

답변

0

이 시나리오에서는 확장 가능한 ListView를 사용해야합니다. 자사의 목록보기 thats 항상 확장. 그래서 ScrollView 안에 넣을 수 있습니다. pullAndReflesh 사용자 정의 목록보기의 경우 확장 가능을 확인하고이를 확장해야합니다. 이 클래스는 Google에서 찾을 수 있습니다.

왜 scrollView 내부에 listView가 있습니까?

때때로 LinearLayout과 함께 사용할 수없는 어댑터를 사용해야하기 때문에.

관련 문제