android-在包含ExpandableListView的RelativeLayout上使用ScrollView

android-在包含ExpandableListView的RelativeLayout上使用ScrollView,第1张

概述我已经使用了这个RelativeLayout:<?xmlversion="1.0"encoding="utf-8"?><RelativeLayoutxmlns:android="http://schemas.android.com/apkes/android"android:orientation="vertical"android:

我已经使用了这个relativeLayout:

<?xml version="1.0" enCoding="utf-8"?>    <relativeLayout        xmlns:androID="http://schemas.androID.com/apk/res/androID"        androID:orIEntation="vertical"        androID:layout_wIDth="match_parent"        androID:layout_height="match_parent">        <button            androID:layout_wIDth="wrap_content"            androID:ID="@+ID/screen_team_enableproximity"            androID:text="Enable proximity"            androID:layout_height="wrap_content"            androID:layout_alignBaseline="@+ID/screen_team_checkBoxproximity"            androID:layout_alignBottom="@+ID/screen_team_checkBoxproximity"            androID:layout_alignParentleft="true"            androID:layout_toleftOf="@+ID/screen_team_checkBoxproximity"></button>        <CheckBox            androID:layout_wIDth="wrap_content"            androID:ID="@+ID/screen_team_checkBoxproximity"            androID:layout_height="wrap_content"            androID:layout_alignParenttop="true"            androID:layout_alignParentRight="true"            androID:clickable="false"></CheckBox>        <ExpandableListVIEw            androID:layout_wIDth="match_parent"            androID:ID="@+ID/screen_team_teamsList"            androID:layout_height="match_parent"            androID:layout_below="@+ID/screen_team_availableteams"            androID:layout_centerHorizontal="true"></ExpandableListVIEw>        <TextVIEw            androID:layout_wIDth="wrap_content"            androID:ID="@+ID/screen_team_availableteams"            androID:text="Available Teams"            androID:layout_height="wrap_content"            androID:textAppearance="?androID:attr/textAppearanceLarge"            androID:layout_below="@+ID/screen_team_getallteams"            androID:layout_centerHorizontal="true"            androID:layout_margintop="10dp"></TextVIEw>        <button            androID:text="Create Team"            androID:ID="@+ID/screen_team_createteam"            androID:layout_height="wrap_content"            androID:layout_below="@+ID/screen_team_enableproximity"            androID:layout_wIDth="match_parent"            androID:layout_margintop="65dip"></button>        <button            androID:text="Delete Team"            androID:ID="@+ID/screen_team_deleteteam"            androID:layout_height="wrap_content"            androID:layout_below="@+ID/screen_team_createteam"            androID:layout_centerHorizontal="true"            androID:layout_wIDth="match_parent"></button>        <button            androID:layout_wIDth="match_parent"            androID:text="Get available teams"            androID:ID="@+ID/screen_team_getallteams"            androID:layout_height="wrap_content"            androID:layout_below="@+ID/screen_team_deleteteam"            androID:layout_alignParentleft="true"></button>    </relativeLayout>

问题是我希望在ScrollVIEw或类似版本中使用它-整个布局在屏幕上不适合,尤其是当您将多个组添加到ExpandableListVIEw时.

我尝试过将relativeLayout放在ScrollVIEw中,但是它根本不起作用.

如何设置带有relativeLayout的滚动屏幕?

解决方法:

将所有视图上方的可扩展ListVIEw用作ListVIEw标头,并将下面所有视图的可作为ListVIEw页脚.然后,您对所有内容都启用了滚动.

总结

以上是内存溢出为你收集整理的android-在包含ExpandableListView的RelativeLayout上使用ScrollView全部内容,希望文章能够帮你解决android-在包含ExpandableListView的RelativeLayout上使用ScrollView所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1084542.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-27
下一篇2022-05-27

发表评论

登录后才能评论

评论列表(0条)

    保存