修改FloatingActioButton應用

現有一個圖標


圖標是一個白圈圈包裹一個垃圾桶。


如果用FloatingActioButton來做,


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
<android.support.design.widget.FloatingActionButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/multitask_delete"
    />
</LinearLayout>

其效果是


怎麼把外面一圈的紅色圓環去掉,只剩下一個圖標(白線圈包裹垃圾桶)呢?

嘗試多種修改:

發現
android:elevation="1dp"的值
android:layout_marginRight="6dp"的有無

app:pressedTranslationZ="6dp"的有無,的值

app:borderWidth="0dp"的有無,

android:scaleType="centerInside"

android:scaleType="fitCenter"

android:scaleType="centerCrop"的取值

android:layout_width="100dp"
    android:layout_height="100dp"

還是

android:layout_width="wrap_content"
    android:layout_height="wrap_content"

都不會對效果有什麼改變。。

都不能讓外面的大圈圈消失。


解決。。

用ImageView代替FloatingActionButton。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章