gpt4 book ai didi

java - ScrollView 不滚动 2 ListView

转载 作者:行者123 更新时间:2023-11-29 04:49:37 24 4
gpt4 key购买 nike

我搜索了很多关于不滚动的 ScrollView 的主题,但没有人能解决我的问题:/如果有人可以帮助我 :)当我从我的服务器发出请求时,每个 ListView 都会打印一些人通常,当我向下滚动我的列表时,会出现第二个列表,但不会出现

<?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 中使用ListViewListView 本身具有滚动属性,您不必使用另一个 ScrollView 来使其滚动。请改用 LinearLayout

关于java - ScrollView 不滚动 2 ListView ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35890348/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com