开发者

Only top corners rounded in <shape>

开发者 https://www.devze.com 2023-04-01 08:46 出处:网络
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

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" an开发者_StackOverflow中文版droid: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?


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


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


Try

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

精彩评论

暂无评论...
验证码 换一张
取 消