I want to make my linear-layout in ring shape.
I followed this Links but i doesn't got ring layout instead I am getting a circular layout.
https://developer.android.com/guide/topics/resources/drawable-resource.html#Shape
How can I create the following layout in xml to use as a background for my android activities?
My xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.ring.MainActivity" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="@drawable/ring"
>
</LinearLayout>
and ring.xml in drawable
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="ring"
android:innerRadius="90dp"
android:thickness="10dp"
android:useLevel="false" >
<solid android:color="#ababf2" />
and I am just getting a circle in my layout not ring.Sorry i cannot upload an image of my output because of my short reputation.
Try this:
ring.xml
your xml
Try this!