android-底部工作表不在线性布局前面

android-底部工作表不在线性布局前面,第1张

概述如何使此底页排在前面而不是下面.BottomSheet放在根linearlayout下方的“协调器布局”中.由于Stackoverflow不允许我添加更多代码,因此我添加了屏幕截图.任何帮助表示赞赏.BottomSheetdoesnotswipesupandstaysunderThisismybottomsheet我的主要活动xml如下所示:<?x

如何使此底页排在前面而不是下面.
BottomSheet放在根linearlayout下方的“协调器布局”中.
由于Stackoverflow不允许我添加更多代码,因此我添加了屏幕截图.
任何帮助表示赞赏.

Bottom Sheet does not swipes up and stays under

This is my bottomsheet

我的主要活动xml如下所示:

<?xml version="1.0" enCoding="utf-8"?>    <linearLayout androID:orIEntation="vertical"    androID:layout_wIDth="match_parent"    androID:layout_height="match_parent"    androID:background="@color/backgroudcolor"    xmlns:androID="http://schemas.androID.com/apk/res/androID">        <relativeLayout            androID:layout_wIDth="match_parent"            androID:layout_height="150sp"            androID:background="@color/colorAccent"            androID:ID="@+ID/relative">            <TextVIEw                androID:ID="@+ID/date"                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:layout_centerVertical="true"                androID:paddingleft="30dp"                androID:paddingRight="15dp"                androID:text="30"                androID:textSize="62sp"                />            <TextVIEw                androID:ID="@+ID/weekDay"                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:text="Monday"                androID:textSize="26sp"                androID:layout_toRightOf="@+ID/date"                androID:layout_aligntop="@+ID/date"                androID:paddingtop="10dp"                />            <TextVIEw                androID:ID="@+ID/dateMonthYear"                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:text="January 2016"                androID:layout_toRightOf="@+ID/date"                androID:layout_margintop="70dp"                androID:paddingtop="5dp"                />        </relativeLayout>        <linearLayout            androID:layout_wIDth="match_parent"            androID:layout_height="60dp"            androID:background="#e74c3c"            androID:ID="@+ID/fajar">            <TextVIEw                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:text="Fajar"                androID:layout_gravity="center_vertical"                androID:textSize="26sp"                androID:paddingStart="10dp"                />        </linearLayout>        <linearLayout            androID:layout_wIDth="match_parent"            androID:layout_height="60dp"            androID:background="#2ecc71"            androID:ID="@+ID/zuhar">            <TextVIEw                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:text="Zuhar"                androID:layout_gravity="center_vertical"                androID:textSize="26sp"                androID:paddingStart="10dp"                />        </linearLayout>        <linearLayout            androID:layout_wIDth="match_parent"            androID:layout_height="60dp"            androID:background="#3498db"            androID:ID="@+ID/asar">            <TextVIEw                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:text="Asar"                androID:layout_gravity="center_vertical"                androID:textSize="26sp"                androID:paddingStart="10dp"                />        </linearLayout>        <linearLayout            androID:layout_wIDth="match_parent"            androID:layout_height="60dp"            androID:background="#9b59b6"            androID:ID="@+ID/maghrib">            <TextVIEw                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:text="Maghrib"                androID:layout_gravity="center_vertical"                androID:textSize="26sp"                androID:paddingStart="10dp"                />        </linearLayout>        <linearLayout            androID:layout_wIDth="match_parent"            androID:layout_height="60dp"            androID:background="#f1c40f"            androID:ID="@+ID/isha">            <TextVIEw                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:text="Isha"                androID:layout_gravity="center_vertical"                androID:textSize="26sp"                androID:paddingStart="10dp"/>        </linearLayout>        <androID.support.design.Widget.CoordinatorLayout            androID:layout_wIDth="match_parent"            androID:layout_height="match_parent"            androID:background="@color/backgroudcolor">            <include layout="@layout/bottomsheet"/>        </androID.support.design.Widget.CoordinatorLayout></linearLayout>

解决方法:

<?xml version="1.0" enCoding="utf-8"?><androID.support.design.Widget.CoordinatorLayout    androID:layout_wIDth="match_parent"    androID:layout_height="match_parent"    androID:background="@color/app_background"    xmlns:androID="http://schemas.androID.com/apk/res/androID">    <linearLayout        androID:layout_wIDth="match_parent"        androID:layout_height="match_parent"        androID:orIEntation="vertical">        <relativeLayout            androID:layout_wIDth="match_parent"            androID:layout_height="150sp"            androID:background="@color/colorAccent"            androID:ID="@+ID/relative">            <TextVIEw                androID:ID="@+ID/date"                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:layout_centerVertical="true"                androID:paddingleft="30dp"                androID:paddingRight="15dp"                androID:text="30"                androID:textSize="62sp"/>            <TextVIEw                androID:ID="@+ID/weekDay"                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:text="Monday"                androID:textSize="26sp"                androID:layout_toRightOf="@+ID/date"                androID:layout_aligntop="@+ID/date"                androID:paddingtop="10dp"/>            <TextVIEw                androID:ID="@+ID/dateMonthYear"                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:text="January 2016"                androID:layout_toRightOf="@+ID/date"                androID:layout_margintop="70dp"                androID:paddingtop="5dp"/>        </relativeLayout>        <linearLayout            androID:layout_wIDth="match_parent"            androID:layout_height="60dp"            androID:background="#e74c3c"            androID:ID="@+ID/fajar">            <TextVIEw                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:text="Fajar"                androID:layout_gravity="center_vertical"                androID:textSize="26sp"                androID:paddingStart="10dp"                androID:paddingleft="10dp" />        </linearLayout>        <linearLayout            androID:layout_wIDth="match_parent"            androID:layout_height="60dp"            androID:background="#2ecc71"            androID:ID="@+ID/zuhar">            <TextVIEw                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:text="Zuhar"                androID:layout_gravity="center_vertical"                androID:textSize="26sp"                androID:paddingleft="10dp"/>        </linearLayout>        <linearLayout            androID:layout_wIDth="match_parent"            androID:layout_height="60dp"            androID:background="#3498db"            androID:ID="@+ID/asar">            <TextVIEw                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:text="Asar"                androID:layout_gravity="center_vertical"                androID:textSize="26sp"                androID:paddingleft="10dp"/>        </linearLayout>        <linearLayout            androID:layout_wIDth="match_parent"            androID:layout_height="60dp"            androID:background="#9b59b6"            androID:ID="@+ID/maghrib">            <TextVIEw                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:text="Maghrib"                androID:layout_gravity="center_vertical"                androID:textSize="26sp"                androID:paddingleft="10dp"/>        </linearLayout>        <linearLayout            androID:layout_wIDth="match_parent"            androID:layout_height="60dp"            androID:background="#f1c40f"            androID:ID="@+ID/isha">            <TextVIEw                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:text="Isha"                androID:layout_gravity="center_vertical"                androID:textSize="26sp"                androID:paddingleft="10dp"/>        </linearLayout>    </linearLayout>    <include layout="@layout/bottomsheet"/></androID.support.design.Widget.CoordinatorLayout>

试试这个xml代码,重要的是不要忘记将layout_behavior属性添加到bottomsheet.xml.

总结

以上是内存溢出为你收集整理的android-底部工作表不在线性布局前面全部内容,希望文章能够帮你解决android-底部工作表不在线性布局前面所遇到的程序开发问题。

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

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

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

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

发表评论

登录后才能评论

评论列表(0条)

    保存