Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom Button/EditBox are invisible?

I get this error when viewing my app. "The graphics preview in the layout editor may not be accurate:
Path.isConvex is not supported. (Ignore for this session)" see picture of error:

Here are the widgets in the activity_main.xml

<ImageButton
    android:id="@+id/ImageButton1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignTop="@+id/RoomEditText"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="48dp"
    android:background="@drawable/button_go"
    android:minHeight="40dp"
    android:minWidth="256dp" />

<EditText
    android:id="@+id/RoomEditText"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/ImageButton1"
    android:layout_below="@+id/imageView1"
    android:layout_marginTop="80dp"
    android:background="@drawable/editbox_round"
    android:ems="10"
    android:gravity="center_vertical|center_horizontal"
    android:inputType="text"
    android:maxLength="15"
    android:minHeight="32dp"
    android:minWidth="256dp" />

Here are the drawables:

button_go.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >

    <gradient
        android:angle="90"
        android:endColor="#cc1a22"
        android:startColor="#550200" />

    <corners
        android:bottomLeftRadius="15dp"
        android:bottomRightRadius="15dp"
        android:topLeftRadius="15dp"
        android:topRightRadius="15dp" >
    </corners>

</shape>  

editbox_round.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >

    <solid android:color="#ffffff" />

    <stroke
        android:width="1dp"
        android:color="#000000"
    />
    <corners 
        android:topLeftRadius="10dp"
        android:topRightRadius="10dp"
        android:bottomLeftRadius="10dp"
        android:bottomRightRadius="10dp"
    />
</shape>

I'm not exactly sure why they are showing up invisible. If someone would be as kind to show me what exactly is going on here?

like image 739
Honor Avatar asked Dec 18 '25 18:12

Honor


1 Answers

You get "Path.isConvex is not supported" error because you get a radius value for each corner separately. You must use

<corners android:radius="10dip" />

instead of

<corners 
    android:topLeftRadius="10dp"
    android:topRightRadius="10dp"
    android:bottomLeftRadius="10dp"
    android:bottomRightRadius="10dp"
/>
like image 139
Bahadir Tasdemir Avatar answered Dec 20 '25 07:12

Bahadir Tasdemir



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!