【问题标题】:How can I add an image to an ExtendedFloatingActionButton (in addition of the icon)?如何将图像添加到 ExtendedFloatingActionButton(除了图标)?
【发布时间】:2020-06-08 00:17:24
【问题描述】:

有没有办法使用 com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton 重现以下行为?

我已经有了正确的图标/形状/颜色,但我找不到制作与图片相同的组件的方法。预期的行为和截图来自https://material.io/components/sheets-bottom/#expanding-bottom-sheet

【问题讨论】:

    标签: android material-design material-components-android material-components


    【解决方案1】:

    您可以使用this 库获得相同的结果。或者只是做同样的CornerSheetBehavior

    这个想法来自material sample。您只需要一个 BottomShetBehavior 并更改 traslationX 的视图取决于 BottomSheetCallback

    中的 slideOffset

    【讨论】:

    • 这是一个有趣的库。但实际上我的问题更多是关于如何在角落添加缩略图(不是图标),而不是关于如何实现 BottomSheet。有没有办法用这个库实现我想要的?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-10-01
    • 2012-10-02
    • 1970-01-01
    • 2017-12-16
    • 2020-12-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多