gpt4 book ai didi

android - scrollView 内的 fragment

转载 作者:太空宇宙 更新时间:2023-11-03 10:49:13 24 4
gpt4 key购买 nike

我需要在 ScrollView 中有一个 arrayAdapter( fragment ),下面有按钮,不幸的是,这样做时我的 fragment 只有一个元素的大小并且正在滚动

这是我的观点:

<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="fill_parent" >

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<fragment
android:id="@+id/myfragment"
android:name="com.myapply.MyListFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="clip_vertical" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TEST TEST TEST"
android:textColor="#FFFFFF"
android:textSize="25dp" />
</LinearLayout>
</ScrollView>

欢迎任何帮助

最佳答案

简短的回答是您不能在 ScrollView 中包含 ListView。这是一个related SO thread .

查看您的布局,您可以将其重新设计为 RelativeLayout:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<fragment
android:id="@+id/myfragment"
android:name="com.myapply.MyListFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="clip_vertical"
android:layout_above="@+id/bottomTextView" />

<TextView
android:id="@+id/bottomTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TEST TEST TEST"
android:textColor="#FFFFFF"
android:layout_alignParentBottom="true"
android:textSize="25dp" />

</RelativeLayout>

关于android - scrollView 内的 fragment ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16962618/

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