- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我一直在尝试在 android 中实现底部工作表 fragment ,但默认情况下无法将其缩放到全屏。我什至尝试将其状态设置为 STATE_EXPANDED
public void setupDialog(Dialog dialog, int style) {
super.setupDialog(dialog, style);
View v = View.inflate(getContext(), R.layout.fragment_my_bottom_sheet_dialog, null);
dialog.setContentView(v);
CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) ((View) v.getParent()).getLayoutParams();
CoordinatorLayout.Behavior behavior = params.getBehavior();
if (behavior != null && behavior instanceof BottomSheetBehavior) {
Log.d(TAG, "Inside if");
((BottomSheetBehavior) behavior).setState(BottomSheetBehavior.STATE_EXPANDED);
((BottomSheetBehavior) behavior).setBottomSheetCallback(mBottomSheetCallback);
}
}
但这弄乱了床单从底部向上 float 的动画。我正在尝试创建一个带有全屏和工具栏的模式底部工作表,带有这样的关闭(X)按钮
如果有人能帮助我,我将不胜感激。
最佳答案
我可以确定的是,您需要一个向上滑动面板来执行设置。我强烈建议您使用 umano 的 Android Sliding Up Panel图书馆。它有2个 child 。一个用于 Activity/fragment ,另一个用于面板。
<com.sothree.slidinguppanel.SlidingUpPanelLayout
xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:id="@+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
sothree:umanoPanelHeight="68dp"
sothree:umanoShadowHeight="4dp">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="Main Content"
android:textSize="16sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center|top"
android:text="The Awesome Sliding Up Panel"
android:textSize="16sp" />
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
关于android - 全屏底页 fragment ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41313375/
我有一些按钮总是 float 在浏览器窗口的底 Angular 。 后退 按钮位于正确的位置,但下一步 按钮不会正确 float 。 #footerback { width: 107px;
有谁知道如何在传统 java 中使用此公式计算三角形的面积而不更改或添加公式中的任何内容? 面积 = 1/2*底*高 如果我像这样修改公式: 面积=1.0f/2*baseheigh 或 1/2.0fb
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 关于您编写的代码问题的问题必须在问题本身中描述具体问题 — 并且包括有效代码 以重现它。参见 SS
我正在使用 jQuery mobile 并有一个 div,我只希望底部的 2 个 Angular 具有 flex 的外观。 根据我的阅读,我明白我应该使用: ui-corner-bl 和 ui-cor
我是一名优秀的程序员,十分优秀!