Android底表工具栏,例如Telegram

问题描述 投票:0回答:1

在我的Android应用程序中,我有底部工作表,我试图使其像应用程序Telegram一样,在底部工作表中出现,它在图像库项目上具有粗边框,当展开到顶部时,它显示了带有旋转器和后退按钮。

我的BottomSheetDialogFragment的布局文件

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:fitsSystemWindows="true"
    android:orientation="vertical"
    android:layout_height="match_parent"
    android:layout_width="match_parent">

    <RelativeLayout

        android:id="@+id/topBarBottomSheet"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <Spinner
            android:id="@+id/attachmentOption"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:layout_marginLeft="10dp"
            android:layout_marginStart="10dp" />



        <ImageButton
            android:id="@+id/closeButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:layout_marginRight="15dp"
            android:background="@drawable/ic_highlight_off_black_36dp"
            android:layout_marginEnd="15dp" />

        <SearchView
            android:id="@+id/searchView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toLeftOf="@id/closeButton"
            android:layout_toStartOf="@id/closeButton"
            android:layout_marginRight="20dp"
            android:layout_marginEnd="20dp" />

        <EditText
            android:id="@+id/searchViewEditText"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Name"
            android:layout_below="@id/searchView"
            android:layout_marginTop="5dp"
            />
    </RelativeLayout>

这是电报在做什么

enter image description here

这是我到目前为止所取得的成就

enter image description here

android android-toolbar bottom-sheet
1个回答
0
投票

您要隐藏底部按钮(图库,文件,位置...),并在使用平滑动画制作全屏时显示微调框而不是标题?

Like this

© www.soinside.com 2019 - 2024. All rights reserved.