我搜索很多關於scrollview的主題,它不滾動,但沒有人能解決我的問題:/ 如果有人可以幫我:) 每個listview打印一些人,當我做一個從我的服務器 請求通常當我滾動我的名單下來第二個列表中出現,但它不Scrollview不滾動2列表視圖
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/selector_for_background_white"
android:orientation="vertical">
<ScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/selector_for_background_white"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/layoutScrollResult"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/selector_for_background_white">
<LinearLayout
android:id="@+id/layout2"
android:layout_width="match_parent"
android:layout_height="40dp"
android:orientation="horizontal">
<com.whask.whask.utils.font.FontTextView
android:id="@+id/text_hot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:background="@android:color/transparent"
android:text="5 HOT"
android:textSize="@dimen/abc_text_size_medium_material"
app:font="Neo-Sans-Std-Medium.otf"/>
</LinearLayout>
<ListView
android:id="@+id/result_whask_listview_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/layout2">
</ListView>
<LinearLayout
android:id="@+id/layout3"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_below="@+id/result_whask_listview_view"
android:orientation="horizontal">
<com.whask.whask.utils.font.FontTextView
android:id="@+id/text_not"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:background="@android:color/transparent"
android:text="2 NOT"
android:textSize="@dimen/abc_text_size_medium_material"
app:font="Neo-Sans-Std-Medium.otf"/>
</LinearLayout>
<ListView
android:id="@+id/result_whask_listview_view_no"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/layout3"
android:background="@color/my_whask_white_color">
</ListView>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
你不應該使用scrollview與listview作爲listview有它自己的滾動。而不是使用列表視圖以線性或框架佈局膨脹項目。通過這種方式,您可以輕鬆實現包裝內容功能,因爲listview無法正確使用換行內容 –
是否需要在scrollview中滾動listview? @Mavrick RMx的 – RushDroid
如果我不使用滾動型,我的2 FontTextView不會滾動,我的第二列表視圖留在底部,我不能看到這些元素,我需要我的FontTextView滾動太@VivekMishra –