代码之家  ›  专栏  ›  技术社区  ›  Adam Varhegyi

floatingActionButton在API 19中有奇怪的背景

  •  1
  • Adam Varhegyi  · 技术社区  · 7 年前

    我的floatingActionButton在API 20+中运行良好,但在API 19中,后面有一个奇怪的圆圈。

    你可以看到橙色圆圈周围有另一个圆角矩形,或者我不知道那是什么…但它就在那里。

    我怎么能把那东西藏起来?< >

    仅在API 19(Android 4.4)上出现

    我使用 'com.android.support:design:26.0.2'

    事先谢谢。

    e d i t:

    我不使用仰角。

    xml源:

    <?xml version=“1.0”encoding=“utf-8”?gt;
    
    
    <线性布局
    
    xmlns:android=“http://schemas.android.com/apk/res/android”
    
    android:layout_width=“包装内容”
    android:layout_height=“包装内容”
    xmlns:app=“http://schemas.android.com/apk/res-auto”
    
    android:clipChildren=“假”
    android:cliptopadding=“假”
    android:orientation=“垂直”
    android:padding=“8dp”>
    
    
    
    <android.support.design.widget.floatingActionButton
    
    android:id=“@+id/流\切换\u btn”
    android:layout_width=“匹配父级”
    android:layout_height=“包装内容”
    app:srccompt=“@drawable/ic_stream_video_white”/>gt;
    
    
    </linearlayout>
    

    你可以看到在橙色的圆周围有另一个圆角矩形或者我真的不知道那是什么…但它就在那里。

    我怎么能把那东西藏起来?

    这个仅在API 19(Android 4.4)上出现

    我用'com.android.support:design:26.0.2'

    事先谢谢。

    E D I T:

    我不使用仰角。

    XML源:

    <?xml version="1.0" encoding="utf-8"?>
    
    
    <LinearLayout
    
        xmlns:android="http://schemas.android.com/apk/res/android"
    
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        xmlns:app="http://schemas.android.com/apk/res-auto"
    
        android:clipChildren="false"
        android:clipToPadding="false"
        android:orientation="vertical"
        android:padding="8dp">
    
    
    
        <android.support.design.widget.FloatingActionButton
    
            android:id="@+id/stream_toggle_btn"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:srcCompat="@drawable/ic_stream_video_white" />
    
    
    </LinearLayout>
    

    1 回复  |  直到 7 年前
        1
  •  2
  •   Anton A.    7 年前

    LinearLayout

    RelativeLayout FrameLayout CoordinatorLayout

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="end|bottom"
        android:layout_margin="16dp"
        app:fabSize="normal"
        app:srcCompat="@drawable/ic_add_white_24dp" />