【问题标题】:How to prevent bottom sheet from animating corner shape to square?如何防止底片将角形状动画化为正方形?
【发布时间】:2021-06-22 18:42:16
【问题描述】:

我的底页是这样设计的

<style name="ShapeAppearanceOverlay.BottomSheet" parent="">
    <item name="cornerSize">30dp</item>
    <item name="cornerFamily">rounded</item>
</style>

而且效果很好,我的底片有 30dp 的角半径,但是如果我在底片上向上推动幻灯片,角会变平,我该如何防止这种情况发生?

【问题讨论】:

标签: android android-layout android-fragments android-bottomsheetdialog


【解决方案1】:

在底部工作表中使用此样式作为透明背景

    <style name="BottomSheetMainStyle" parent="ThemeOverlay.MaterialComponents.Light.BottomSheetDialog">
        <item name="bottomSheetStyle">@style/Widget.Test.BottomSheet.Modal</item>
    </style>

    <style name="Widget.Test.BottomSheet.Modal" parent="Widget.MaterialComponents.BottomSheet.Modal">
        <item name="backgroundTint">@android:color/transparent</item>
    </style>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-24
    • 1970-01-01
    • 1970-01-01
    • 2014-09-07
    • 2018-12-14
    • 1970-01-01
    相关资源
    最近更新 更多