android - Transparent circle with border -


i trying create circle border using xml in android:

<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" >  <stroke android:width="1dp"     android:color="#000000"/>  </shape> 

the code i've used posted above. however, solid disk , not ring. output using xml , not canvas. doing wrong?

thanks.

edit: got work answer below. heres final code:

<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"     android:innerradius="0dp"     android:shape="ring"     android:thicknessratio="1.9"     android:uselevel="false" >      <solid android:color="@android:color/transparent" />      <size android:width="100dp"      android:height="100dp"/>      <stroke android:width="1dp"     android:color="#ffffff"/>  </shape> 

try this

<shape xmlns:android="http://schemas.android.com/apk/res/android"     android:innerradius="0dp"     android:shape="ring"     android:thicknessratio="2"     android:uselevel="false" >     <solid android:color="@android:color/transparent" />      <stroke         android:width="2dp"         android:color="@android:color/darker_gray" /> </shape> 

update: made android:thicknessratio="2" give full circle (using nexus 5 - lollipop)


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -