材料设计理念 - 底部工作表从屏幕底部向上滑动以显示更多内容。
我有一个方法对地图单击采取行动,当我单击地图时,方法尝试将状态设置为 STATE_SETTLING 但它抛出 IllegalArgumentException 我已经检查过状态是否...
Android Compose:通过拖动或后按关闭底部工作表时屏幕冻结
我正在使用 Jetpack Compose 开发 Android 应用程序,并且遇到了一个问题:当我与底部工作表交互时(向下拖动它或使用后退按钮将其关闭),我的屏幕变成
iOS 16.4,SwiftUI 底部工作表有时会忽略presentationDetents
从 SwiftUI 中的 iOS 16.4 开始,我们可以使用 .sheet 修饰符和 .presentationDetents 来指定底部工作表的高度。我们可以进一步使用 .presentationBackgroundInteraction 来允许交互...
我正在开发一个 iOS 应用程序,我想实现一个显示在 TabBar 上方的底部工作表。 我想要得到附件中的外观。 在此输入图像描述 我很欣赏...
bottom_sheet_image_dialog.xml: bottom_sheet_image_dialog.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" app:behavior_hideable="false" app:behavior_peekHeight="62dp" app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:id="@+id/llAddDriverPic" android:background="?android:attr/selectableItemBackground" android:padding="8dp"> <ImageView android:layout_width="24dp" android:layout_height="24dp" android:src="@drawable/baseline_add_photo_alternate_24" android:layout_margin="8dp"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/add_picture" android:layout_gravity="center_vertical" android:padding="8dp"/> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:id="@+id/llRemoveDriverPic" android:background="?android:attr/selectableItemBackground" android:padding="8dp"> <ImageView android:layout_width="24dp" android:layout_height="24dp" android:src="@drawable/baseline_no_photography_24" android:layout_margin="8dp"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/remove_picture" android:layout_gravity="center_vertical" android:padding="8dp"/> </LinearLayout> 代码实现: BottomSheetDialog bsDialog = new BottomSheetDialog(getContext()); bsDialog.setContentView(R.layout.bottom_sheet_image_dialog); bsDialog.setOnShowListener(dialog -> { BottomSheetBehavior bottomSheetBehavior = ((BottomSheetDialog)dialog).getBehavior(); bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED); }); 发生以下问题:视频中看到的宽度不会完全显示。 如果我在横向模式下从一开始就启动底页,宽度看起来也会不同,因为左侧和右侧没有被覆盖: 问题可能是什么? 显示对话框之前是否需要预先定义宽度? -> 你的xml布局没有问题,可以用代码解决。我在下面提供了一个解决此问题的示例。 => 底表类代码 public class BottomSheet extends BottomSheetDialogFragment { private View view; private BottomSheetBehavior mBottomBehavior; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { view = inflater.inflate(R.layout.bottom_sheet_layout, container, false); //Do your logic code here return view; } @Override public void onStart() { super.onStart(); mBottomBehavior = BottomSheetBehavior.from((View) view.getParent()); mBottomBehavior.setMaxWidth(ViewGroup.LayoutParams.MATCH_PARENT); mBottomBehavior.setState(BottomSheetBehavior.STATE_EXPANDED); } } => 活动类别代码 Button button = findViewById(R.id.button); button.setOnClickListener(v -> { //To open the bottom sheet, NB. make sure 'BottomSheet' is the name you declared Bottom sheet class BottomSheet bottomSheet = new BottomSheet(); bottomSheet.show(getSupportFragmentManager(), "exampleBottomSheet"); }); 在科特林中: val dialog = BottomSheetDialog(context).apply { setContentView(bottomSheet.root) behavior.maxWidth = ViewGroup.LayoutParams.MATCH_PARENT behavior.state = BottomSheetBehavior.STATE_EXPANDED }
我正在尝试在 ElevatedButton 上 onPressed 之后实现 showBottomSheet,但出现以下错误 ======== 手势捕获异常======================================== =============...
使用 @gorhom/bottom-sheet 时 ReactNative 应用程序崩溃
我们有一个 Nx monorepo 工作区,其中包含 React Web 应用程序和 ReactNative 移动应用程序设置。 我们正在尝试使用@gorhom/bottom-sheet,但是一旦我们呈现bottomsheet,移动应用程序就会崩溃......
我有以下可组合的底页。 我希望能够通过拖动、单击背景并单击关闭按钮来关闭底页。 @可组合 有趣的 CDSModelBottomSheet(
Android compose ModalBottomSheetLayout 导致巨大的重组计数
我现在正在使用 compose 工作几个星期,我认为有些事情仍然相当具有挑战性或很奇怪。 我的最新功能需要一个 BottomSheet,准确地说是一个 ModalBottomSheet。 检查时...
我正在构建一个颤振应用程序,在某些时候,我必须添加一个底部工作表,所以我使用了“showModalBottomSheet”。我还想在其中显示一个导航栏,所以我添加了一个
flutter:bottomSheet 可拖动且具有动画效果
我正在开发一个应用程序,当用户单击按钮以显示更多信息时,我想显示底部工作表,如下例所示 这是一个例子:https://i.ibb.co/7bjgNRg/
如何限制在点击外部时关闭 showModalBottomSheet?
我有两个页面,正在使用 showModalBottomSheet 导航到第二个页面。在第二页上,我使用了 DraggableScrollableSheet。当文本表单字段为空时,我必须限制底部工作表
关闭 BottomSheet Flutter 时如何将数据保留在其中?
我对 Flutter(和编程)非常陌生。 我有一个 BottomSheet,其中包含 ChoiceChips 和一些开关。一切都很好,但是当我关闭 BottomSheet 时,它不会保存开关的状态...
当 BottomSheetTextInput 处于活动状态时,React Native 中的 BottomSheetView (@gorhom/bottom-sheet) 会缩小一半高度
我正在为 React Native (Typescript) 项目使用 @gorhom/bottom-sheet 库,在 BottomSheetView 中,我有 BottomSheetTextInput 组件。当按下 BottomSheetTextInput 时,我的 BottomSheet s...
我遵循了一些教程,并完全按照发球台创建底页,但它就是打不开。 我收到的唯一消息是“I/flutter ( 6593): 抛出了另一个异常:否
@gorhom/bottom-sheet - 儿童视图的动态高度
如何通过设置捕捉点或其他方式来设置儿童视图的动态高度? 这是我的父组件和子组件代码。 需要通过删除多余的空格来设置模态的动态高度
我正在创建应用程序,其中我使用了 ShowModelBottomSheet,其中我创建了两个选项卡栏 我用这些来编辑我的记录 就像当用户按下编辑按钮时,底部工作表打开并且记录已经存在
如何使用BottomSheetScaffold(Jetpack compose)的sheetContent在横向模式下填满整个屏幕?
我想用底板脚手架在横向模式下填充整个屏幕,但它的左右两侧总是有一些剩余空间:示例结果 我已经删除了所有可能的垫...
我的应用程序需要实现一个具有 3 种状态的底部表(展开、一半_展开、折叠) 我试着寻找一些库来支持这个,但我没有找到,在底部我需要实现一个
在 UISheetPresentationController 中自定义较小的 Detents?
Apple 终于在 2021 年的 iOS 15 中发布了一个 Apple Maps 风格的“bottom sheet”控件:UISheetPresentationController。 这种类型的床单本身支持“制动器”,高度......