【问题标题】:Plus Icon in Floating Action Button not rendered correctly in Android pre-Lollipop浮动操作按钮中的加号图标在 Android pre-Lollipop 中未正确呈现
【发布时间】:2015-06-28 02:47:36
【问题描述】:

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

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(棒棒糖)上,加号图标正确呈现。

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

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

使用的图标大小:

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

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

【问题讨论】:

  • 出于某种奇怪的原因,我再也看不到材料图标上的“加号”了。你在哪里找到的?
  • 请用文字“添加”搜索,您可以在“内容”部分找到图标

标签: android floating-action-button


【解决方案1】:

更新

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


正如FloatingActionButton, square button below API level 17上所说的那样

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

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

【讨论】:

    猜你喜欢
    • 2016-04-06
    • 2018-05-21
    • 1970-01-01
    • 2015-01-08
    • 1970-01-01
    • 2016-03-02
    • 1970-01-01
    • 1970-01-01
    • 2017-05-19
    相关资源
    最近更新 更多