gpt4 book ai didi

java - FloatingActionButton 黑框

转载 作者:数据小太阳 更新时间:2023-10-29 03:02:02 25 4
gpt4 key购买 nike

我正在使用这个 https://github.com/makovkastar/FloatingActionButton我项目中的 FloatingActionButtons 库。

在一些较小的设备上,例如 Acer Liquid Z4(Android 版本 4.2.2,屏幕 480x800)或 Genymotion Galaxy S2 图像(Android 版本 4.1.1,屏幕 480x800),FAB 周围有一个黑框:

enter image description here

我试图缩小范围,从我的主题中删除所有特殊内容,使其看起来像这样:

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->

</style>

并且还将按钮放在最简单的布局中:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="de.immowelt.android.immobiliensuche.ui.FabTestActivity">


<com.melnykov.fab.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

</RelativeLayout>

但盒子还在。另一方面,我试图用一个新项目重新创建效果,但无法做到。

当使用 mini 尺寸版本或禁用阴影时,该框会消失。

对我的问题有什么想法吗?

PS:我尝试清理项目;)

最佳答案

我正在使用那个库,但后来决定制作自己的库,将其设置为 imageButton 或其他东西的背景。我使用了 textview,因为我只需要一个 +。它在我的应用程序中看起来很不错。

    <?xml version="1.0" encoding="utf-8"?>

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">


    <!-- Drop Shadow Stack -->

    <item>

        <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" >

            <padding android:right="1dp" android:bottom="1dp" />

            <solid android:color="#00262626" />

        </shape>

    </item>

    <item>

        <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" >

            <padding android:right="1dp" android:bottom="1dp" />

            <solid android:color="#0D262626" />

        </shape>

    </item>

    <item>

        <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" >

            <padding android:right="1dp" android:bottom="1dp" />

            <solid android:color="#26262626" />

        </shape>

    </item>


    <!-- Background -->

    <item>

        <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" >

            <solid android:color="#448AFF"/>

        </shape>

    </item>

</layer-list>

关于java - FloatingActionButton 黑框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28833371/

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