Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shadow effects appear abnormal! #195

Open
MewX opened this issue May 14, 2015 · 1 comment
Open

Shadow effects appear abnormal! #195

MewX opened this issue May 14, 2015 · 1 comment

Comments

@MewX
Copy link

MewX commented May 14, 2015

qq 20150514130102

As is seen in the image, I use below xml code, and get that effects.
And I add <item name="android:elevation">6dp</item> attribute in styles.xml.

    <!-- Floating action button -->
    <com.getbase.floatingactionbutton.FloatingActionsMenu
        android:id="@+id/multiple_actions"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true"
        fab:fab_addButtonColorNormal="@color/fabRed"
        fab:fab_addButtonColorPressed="@color/fabRedPressed"
        fab:fab_addButtonPlusIconColor="@color/myTextPrimaryColor"
        fab:fab_labelStyle="@style/menu_labels_style"
        android:paddingBottom="8dp"
        android:paddingRight="8dp"
        android:paddingEnd="8dp">

        <com.getbase.floatingactionbutton.FloatingActionButton
            android:id="@+id/fab_favorate"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            fab:fab_size="mini"
            fab:fab_icon="@drawable/ic_favorate"
            fab:fab_plusIconColor="@color/myTextPrimaryColor"
            fab:fab_title="@string/fab_favorate"
            fab:fab_colorNormal="@color/fabYellow"
            fab:fab_colorPressed="@color/fabYellowPressed"/>

        <com.getbase.floatingactionbutton.FloatingActionButton
            android:id="@+id/fab_download"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            fab:fab_size="mini"
            fab:fab_icon="@drawable/ic_download"
            fab:fab_plusIconColor="@color/myTextPrimaryColor"
            fab:fab_title="@string/fab_download"
            fab:fab_colorNormal="@color/fabGreen"
            fab:fab_colorPressed="@color/fabGreenPressed"/>

    </com.getbase.floatingactionbutton.FloatingActionsMenu>

Update:

        android:paddingBottom="8dp"
        android:paddingRight="8dp"
        android:paddingEnd="8dp">

This causes the right & buttom abnormal visual effects.
But what's the reason of top & left shadow cut problem?

@bygideon
Copy link

bygideon commented Mar 3, 2017

I know this question is aged, but I'll just reply in case anyone else facing the same issue.

To prevent this problem from happening, margin should be used instead of padding. For the explaination, you can refer to this link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants