Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Only top corners rounded in <shape>

Tags:

android

I am trying to have the top corners of a shape rounded and the bottom just straight, but I'm having a problem with my shape it's saving

error! UnsupportedOperationException: null

When I have

<corners android:radius="10dp" android:bottomRightRadius="0dp"
    android:bottomLeftRadius="0dp" android:topRightRadius="10dp"
    android:topLeftRadius="10dp" />

I have tried putting 1dp in the bottom corners and taking out the android:radius="10dp", but still gives me an error.

Android 2.2 with Eclipse

Can any one help me?

like image 432
M_K Avatar asked Sep 02 '11 14:09

M_K


People also ask

What is the name for a rounded edge?

The word "squircle" is a portmanteau of the words "square" and "circle". Squircles have been applied in design and optics.

Why does everything have rounded corners now?

This is a classical conditioning principle where our brain is conditioned to think sharp objects can be harmful. A real-life example where sharp corners are considered harmful is when you're baby-proofing your house by using rounded fittings on sharp table corners.

What are rounded corners?

"Rounded Corners" is a finishing technique used to improve the aesthetics and/or functionality of certain printed pieces. For example, business cards and promotional brochures are often designed with rounded corners to achieve a unique look.


2 Answers

The tool in Eclipse isn't correct, deploy it to a real device and you should see that it is fine.

like image 85
C0deAttack Avatar answered Sep 23 '22 02:09

C0deAttack


For me it worked fine when i changed 0dip to 0.1dip. Tested on android 1.6

<corners android:bottomRightRadius="0.1dp"
         android:bottomLeftRadius="0.1dip"
         android:topLeftRadius="10dip"
         android:topRightRadius="10dip"/>

But on the other hand I didn't get any error when I had 0dip. The problem was that all corners was getting 0dip, so it's possible you got another error in the xml

like image 38
drewi Avatar answered Sep 25 '22 02:09

drewi