ZieIony / Carbon

Material Design implementation for Android 4.0+. Shadows, ripples, vectors, fonts, animations, widgets, rounded corners and more.

Home Page:https://androidreclib.wordpress.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pixelated corners on carbon.widget.FrameLayout

ildar2 opened this issue · comments

When I try to apply round corners on FrameLayout, they get edgy and pixelated. How to make them smooth?
pixelated corners

           <carbon.widget.FrameLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginBottom="24dp"
                            android:layout_marginLeft="16dp"
                            android:layout_marginRight="16dp"
                            android:layout_marginTop="28dp"
                            app:carbon_cornerRadius="5dp"
                            app:carbon_elevation="2dp">

That's interesting. What kind of device is this?

Device is Xiaomi 5A

Problem solved by adding
app:carbon_elevationShadowColor="@color/black"
and
android:background="@color/white"
normal

Although if you add app:carbon_elevationShadowColor only, you'll get weird result:
wierd shadow

I didn't notice that you don't have any background set. All the results you're getting are not bugs. The correct solution is to set background to any nontransparent color, because if the widget is transparent, the shadow can be seen through it. Changing shadow color will cause the widget to use alternate, software method of rendering shadows on Android 5.0+, so it's not recommended unless you really need colored shadows.