android – Scrollview使底部视图在Dialog中消失

android – Scrollview使底部视图在Dialog中消失,第1张

概述我有一个对话框,在ScrollView中有一个列表(在LinearLayout中有一堆TextViews).布局如下: <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="ma 我有一个对话框,在ScrollVIEw中有一个列表(在linearLayout中有一堆TextVIEws).布局如下:
<?xml version="1.0" enCoding="utf-8"?><linearLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"    androID:layout_wIDth="match_parent"    androID:layout_height="match_parent"    androID:orIEntation="vertical" >    <Progressbar        androID:ID="@+ID/delete_progress"        androID:layout_wIDth="wrap_content"        androID:layout_height="wrap_content"        androID:visibility="gone" />    <ScrollVIEw        androID:ID="@+ID/filename_scroll"        androID:layout_wIDth="match_parent"        androID:layout_height="wrap_content" >        <linearLayout            androID:ID="@+ID/filename_container"            androID:layout_wIDth="match_parent"            androID:layout_height="wrap_content"            androID:orIEntation="vertical" >        </linearLayout>    </ScrollVIEw>    <VIEw        androID:ID="@+ID/horisontal_separator"        androID:layout_wIDth="fill_parent"        androID:layout_height="1dp"        androID:background="@androID:color/darker_gray" />    <linearLayout        androID:ID="@+ID/button_container"        androID:layout_wIDth="match_parent"        androID:layout_height="48dp" >        <button            androID:ID="@+ID/load_button"            androID:layout_wIDth="0dp"            androID:layout_height="wrap_content"            androID:text="@string/button_load"            androID:gravity="center"            androID:layout_weight="1" />        <VIEw            androID:layout_wIDth="1dp"            androID:layout_height="fill_parent"            androID:background="@androID:color/darker_gray" />        <button            androID:ID="@+ID/delete_button"            androID:layout_wIDth="0dp"            androID:layout_height="wrap_content"            androID:text="@string/button_delete"            androID:gravity="center"            androID:layout_weight="1" />    </linearLayout></linearLayout>

它看起来像只有列表中的几个项目:

但是当屏幕上有更多可以放在屏幕上时(并且实际需要滚动),我的按钮会被推到屏幕下方.当一直滚动到底部时,它看起来像这样:

我需要包含按钮的linearLayout作为页脚保留,它不应该在任何地方滚动,显然不会消失.我试图摆弄布局高度和重量,但无济于事.

解决方法@H_419_12@ 尝试在scrollVIEw中更改
<ScrollVIEw    androID:ID="@+ID/filename_scroll"    androID:layout_wIDth="match_parent"    androID:layout_weight="1"    androID:layout_height="0dp" >
总结

以上是内存溢出为你收集整理的android – Scrollview使底部视图在Dialog中消失全部内容,希望文章能够帮你解决android – Scrollview使底部视图在Dialog中消失所遇到的程序开发问题。

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

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

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

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

发表评论

登录后才能评论

评论列表(0条)

    保存