问题标签 [bottomsheetdialogfragment]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
3236 浏览

android - 如何在 ButtomSheetDialogFragment Android 中设置左右边距?

我试图在ButtonSheetDialogFragment布局中设置 Margin 但它不起作用。我试图从布局和编程中设置边距,但结果相同

这是我的 XML 文件 layout_bts_item.xml

这是我的java代码

0 投票
1 回答
63 浏览

android - 防止 BottomSheetDialogFragment 隐藏键盘

如果我在当前活动/片段中打开了键盘,当我呈现 BottomSheetDialogFragment 时,键盘会被关闭,但我希望键盘保持在 BottomSheetDialogFragment 后面的背景中。当我显示 BottomSheetDialogFragment 并防止键盘被关闭时,有没有办法让键盘在 bottomSheetDialogFragment 后面打开?

我正在显示这样的 BottomSheetDialogFragment:

0 投票
1 回答
618 浏览

android - Android BottomSheetDialogFragment 闪烁

我从 BottomSheetDialogFragment 开始活动。

但是当我完成 Activity 时,BottomSheetDialogFragment 正在闪烁。

我的情况就是这样一个BottomSheetDialog 背景闪烁

但是没有解决办法。

这是我的屏幕截图

代码简单而基本。

MainActivity.class

BottomSheetFragment.class

0 投票
0 回答
48 浏览

android - 使用相同布局显示全视图和半视图时视图的BottomSheetDialog对齐

我有一个布局(名为 mirroring.xml),我需要在两个不同的活动中使用它。第一个activity,需要根据android手机的全长和全宽显示内容。第二个活动使用布局仅显示一半屏幕。为了实现这一点,我使用了bottomSheetDialog 和BottomSheetFragment。但由于我对全视图和半视图使用相同的布局,全屏视图工作正常,但半屏视图切断了一些视图,并且视图的对齐方式不正确。在这种情况下,我是否需要使用 bottomSheetDialog 为半屏视图使用单独的布局?

0 投票
0 回答
113 浏览

java - BottomSheet DialogFragment 被键盘覆盖

我见过类似的问题,但没有一个答案能解决我的问题。我有一个带有 editText 和按钮的简单 BottomSheetDialogFragment,当我选择 editText 时,键盘会覆盖按钮。

我测试了这个问题的几个答案,但没有任何运气: Bottom Sheet Fragment come up with keyboard

我的BottomSheetDialogFragment:

片段对话框布局:

我用这个方法在我的活动中显示它,并以一个简单的 linearLayout 作为参数:

0 投票
1 回答
858 浏览

android - java.lang.IllegalStateException: Fragment already added exception for BottomSheetDialogFragment

In order to show a last state in a BottomSheetDialogFragment I try to implement as below,

*) Activity:

*) BottomSheetDialogFragment

So that there is only one instance of BottomSheetDialogFragment and I need to keep a reference of many othervariables that the user has interacted with when the bottom sheet last time opened.

By doing the above steps I am able to achieve our requirement but several times it is randomly crashing and I am unable to find the root cause.

*) Exception:

I know there are already many existing questions with an exact similar exception and the closest which I can think of is this.

Also, I have to use BottomSheetDialogFragment and can not use "Persistent Bottom Sheet". I seriously hope that Android should provide show and hide feature for "Modal Bottom Sheet" and not dismiss every time it closes.

*) Questions:

1) How to prevent this crash?

2) Is there a way to "hide" Modal Bottom Sheet without "dismiss"?

0 投票
0 回答
124 浏览

android-recyclerview - RecyclerView 在底部片断中不可见

我有一个底部表单片段,其中包含一个标题、一个子标题和一个回收器视图,以显示某种报价。下面是布局。

在这里,我的回收站视图不可见。我已将其设置android:layout_height为 0dp。如果我将其更改为wrap_content,回收站视图是可见的,但它与子标题重叠。

0 投票
0 回答
156 浏览

android - 使用导航组件对 DialogFragment 进行动画转换

导航组件是否支持 DialogFragment 的动画转换?

我的对话:

anim/no_animation

当我导航到动作中声明的目的地时,将显示其默认动画,而不是在@anim/no_animation.

0 投票
1 回答
39 浏览

android - 在 BottomSheetDialogFragment 中使用 VideoView 时,视频总是在顶部加载

我想在具有 140dp 高度的 BottomSheetDialogFragment 中的 VideoView 中加载视频,但是当我打开对话框时,视频正在屏幕顶部播放

BottomSheetDialogFragment:

XML 代码:

Java 代码:

这就是现在的样子

0 投票
1 回答
251 浏览

kotlin - 将父视图发送给子视图 (BottomSheetDialogFragment)

今天我想知道是否有可能做到这一点。我的意思是,当我加载子视图时发送父视图。换句话说,当我在孩子身上时,我想处理父母。

父视图

子视图

如果有可能,我不知道,或者如果您有其他建议,我会在这里听取和学习。

太感谢了!