Posts

Showing posts from September, 2021

Android - Layout Rounded Corners

Image
 Lets see how to apply rounded corners to layouts in Android. 1. Create an Android project with an empty activity. 2. Create a drawable named rounded_corner_drawable.xml inside drawable resources folder. 3. Add following code into created file. <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android">     <solid android:color="#FF4F79"/>     <corners android:radius="35dp"/> </shape> 4. Open activity layout XML file. 5. Add following layouts into layout file. <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:app="http://schemas.android.com/apk/res-auto"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"     android:layout_height="ma...