Reputation: 267
I have a circle png that I put as a background image in a TextView. However, the image shows up transparent even when I tried setting the alpha level to "1". Is there something wrong I did in my XML code?
<TextView
android:id="@+id/timeline_text_details_img"
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_gravity="center"
android:layout_marginTop="25dp"
android:background="@drawable/circle"
android:gravity="center"
android:textColor="#fff"
android:textSize="14dp"
android:alpha="1"
android:textStyle="bold" />
The circle png I want needs to be thick white like how it originally is
but instead it looks like this when I run it
Upvotes: 1
Views: 42
Reputation: 11782
You can simply create a shape circle.xml
and place it in drawable
.
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<stroke
android:width="2dp"
android:color="@android:color/white"
/>
<solid
android:color="#000000"/>
</shape>
You can change the color scheme as you like.
Upvotes: 2