I just can’t figure it out. I have this shape in res/drawable/start_light.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="ring"
android:innerRadius="20dp"
android:thickness="0dp"
android:useLevel="false">
<solid android:color="#FF0000" />
</shape>
In res/values/styles.xml I have:
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<style name="StartLight">
<item name="android:layout_height">50dp</item>
<item name="android:layout_width">50dp</item>
<item name="android:background">@drawable/start_light</item>
</style>
</resources>
And in main layout I have:
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_gravity="center_horizontal"
android:layout_width="wrap_content"
android:gravity="center_vertical" android:layout_height="150dp">
<ImageView android:src="@drawable/start_light" android:id="@+id/light5" android:layout_width="50dp" android:layout_height="50dp"></ImageView>
<View style="@style/StartLight" android:id="@+id/light4"></View>
<View style="@style/StartLight" android:id="@+id/light3"></View>
<View style="@style/StartLight" android:id="@+id/light2"></View>
<View style="@style/StartLight" android:id="@+id/light1"></View>
</LinearLayout>
In ether way, using View or ImageView I dont see any red circles in my layout on emulator nor device. On xml graphical designer they are there. What am I missing here?
Replace your shape drawable with
Setting the thickness as 0 made it not visible on the emulator.
Here i set the innerRadius as 0.