Open zyyoona7 opened 5 years ago
The parent ViewGroup setLayerType(View.LAYER_TYPE_SOFTWARE ,null) include RoundRectView round corner not working below Android P.
<FrameLayout android:id="@+id/fl_container_2" android:layout_width="150dp" android:layout_height="150dp" android:layout_marginTop="30dp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tv_border"> <com.github.florent37.shapeofview.shapes.RoundRectView android:layout_width="match_parent" android:layout_height="match_parent" app:shape_roundRect_topLeftRadius="10dp"> <View android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/colorPrimaryDark" /> </com.github.florent37.shapeofview.shapes.RoundRectView> </FrameLayout>
val container2=findViewById<FrameLayout>(R.id.fl_container_2).apply { setLayerType(LAYER_TYPE_SOFTWARE,null) }
why do you set LAYER_TYPE_SOFTWARE manually ?
I want to set shadow background for container2 by Paint.setShadowLayer(), because I want to change shadow color
container2
The parent ViewGroup setLayerType(View.LAYER_TYPE_SOFTWARE ,null) include RoundRectView round corner not working below Android P.