Creating a Circular FrameLayout

I am working on creating a Framelayout pie chart. When I google, I had a suggestion to make an xml file. I did this in the background for FrameLayout as my xml file. But this has no effect. My xml file for ring shape

<?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 the whole ring and oval shape. No one worked. Please help me with this.

+3
source share
2 answers

Do you actually set the background attribute in your layout just by making the shape not enough, you should also apply it to FrameLayout using

android:background=""
0
source

New available:

<?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 the frame layout:

<FrameLayout
    android:layout_width="40dp"
    android:layout_height="40dp"
    android:background="@drawable/your_new_drawable" />
0
source

All Articles