Android:如何更改app的大小:fabSize ="normal"浮动动作按钮 [英] Android: How to change size of app:fabSize="normal" for Floating Action Button
本文介绍了Android:如何更改app的大小:fabSize ="normal"浮动动作按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用新的FloatingActionButton
时,大小由app:fabSize="normal"
确定.如何在dp
中设置"normal"
引用的大小?
When using the new FloatingActionButton
, the size is determined by app:fabSize="normal"
. How can I set what in dp
is the size referenced by "normal"
?
我尝试创建values/attrs.xml
:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="app">
<attr name="fabSize">
<enum name="mini" value="50dp" />
<enum name="normal" value="100dp" />
</attr>
</declare-styleable>
</resources>
但是我得到了错误
"normal" in attribute "fabSize" is not a valid integer
推荐答案
有两种不同大小的FAB
可用:normal
或mini
There are two different sizes of FAB
available: normal
or mini
-
Normal (56dp)
—在大多数情况下应使用此大小.
Normal (56dp)
— This size should be used in most situations.
Mini (40dp)
-仅在需要与屏幕上显示的其他组件保持视觉连续性时才使用.
Mini (40dp)
— Should only be used when there is a need for visual continuity with other components displayed on the screen.
这篇关于Android:如何更改app的大小:fabSize ="normal"浮动动作按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文