Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making circular FrameLayout

I'm working on making Framelayout circular. When I google I got some suggestion of making xml file of it. I did it and in background to FrameLayout as my xml file. But it has no effect. My xml file for ring shape is

<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="ring"
android:innerRadius="15dp"
android:thickness="10dp"
android:useLevel="false">

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

</shape>

I tried all ring and oval shape. None worked. Please help me on this.

like image 442
user2955143 Avatar asked Apr 24 '26 23:04

user2955143


1 Answers

New drawable:

<?xml version="1.0" encoding="utf-8"?>
<shape
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval">
    <solid android:color="#6a000000" />
    <size android:height="25dp"
        android:width="25dp"/>
</shape>

In your frame layout:

<FrameLayout
    android:layout_width="40dp"
    android:layout_height="40dp"
    android:background="@drawable/your_new_drawable" />
like image 139
Pablo Cegarra Avatar answered Apr 27 '26 12:04

Pablo Cegarra



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!