Android: Create bigger Floating Action Button with bigger icon

前端 未结 8 513
陌清茗
陌清茗 2021-02-02 11:02

I want to create a bigger Floating Action Button (FAB), more than the usual 56 dp, with a bigger icon inside. (For my purpose an icon will never be self-explanatory so I will cr

8条回答
  •  礼貌的吻别
    2021-02-02 11:35

    You can try to redefine the maximum size of the fab image size in your dimensions.xml:

    
        80dp
        48dp
    
    

    Must make sure you override the original resources in the Design Library. Try design_fab_image_size instead of design_fab_content_size if this does not work for you.

    Use with care as this is a hack not an actual solution. Solution might not work if the resource's name is changed in the future Design Library release. My opinion is to stick with the size that is define in the Design Library as it is the recommended design guideline based on the Material Design which make your overall app looks good.

提交回复
热议问题