gpt4 book ai didi

android - float 操作按钮中的加号图标在 Android pre-Lollipop 中未正确呈现

转载 作者:IT王子 更新时间:2023-10-28 23:31:55 29 4
gpt4 key购买 nike

我尝试使用支持设计库来设置晶圆厂。

XML 中的代码:

<android.support.design.widget.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/fab"
android:src="@drawable/ic_add_white_18dp"
app:borderWidth="2dp"
app:fabSize="normal"
android:onClick="submit"
app:rippleColor="@color/colorPrimaryDark">

</android.support.design.widget.FloatingActionButton>

在 Nexus 6( Lollipop )上,加号图标正确呈现。

enter image description here

但在nexus 4( Lollipop 前)上,加上图标大小正在穿过圆圈。

enter image description here

我已经从 Material icons 下载并使用了 plus(ic_add_white_18dp)

使用的图标大小:

mdpi - 18dp
hdpi - 27dp
xdpi - 36dp
xxdpi - 54dp

enter image description here

加号图标的正确尺寸应该是多少。

最佳答案

更新

从 v22.2.1 开始,此问题已得到修复。


正如 FloatingActionButton, square button below API level 17 中所述

其中引用了此错误:https://code.google.com/p/android/issues/detail?id=175067

你的 FAB 应该有 app:borderWidth="0dp"

关于android - float 操作按钮中的加号图标在 Android pre-Lollipop 中未正确呈现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31095671/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com