VIN*_*VIN 8 android bottom-sheet android-bottomsheetdialog
我在一些流行的应用程序中在BottomSheets 上看到过这种灰色的把手装饰。这是 Google Maps 中 BottomSheet 的屏幕截图。注意BottomSheet 顶部的灰色手柄/夹具。
实现这样的装饰或背景的最佳方法是什么?这个装饰有标准材质或者安卓风格吗?

我将抓斗/手柄的 SVG 插入到底部工作表的布局中。
MyBottomSheetDialogFragmentLayout.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
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:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/bottomSheetGrapple"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/topMargin"
android:src="@drawable/ic_bottom_sheet_grapple"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
.... // rest of layout
</androidx.constraintlayout.widget.ConstraintLayout>
Run Code Online (Sandbox Code Playgroud)
ic_bottom_sheet_grapple.xml
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="3dp"
android:viewportWidth="24"
android:viewportHeight="3">
<path
android:fillColor="@android:color/darker_gray"
android:pathData="M 1.5 0 L 22.5 0 Q 24 0 24 1.5 L 24 1.5 Q 24 3 22.5 3 L 1.5 3 Q 0 3 0 1.5 L 0 1.5 Q 0 0 1.5 0 Z"
android:strokeWidth="1" />
</vector>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
953 次 |
| 最近记录: |