Android中矩形圆角的最大值

Android中矩形圆角的最大值,第1张

概述我想要得到一个如图所示的形状,一个角落完全是圆形的矩形:但似乎我不能在这个数字中获得“更圆”的角落:这是为什么?<cornerandroid:radius=“integer”/>?的最大值当然我可以用png做到这一点,但我认为使用形状更有效率,所以我更喜欢这样.我的代码:<Buttonandroid:id="@+i

我想要得到一个如图所示的形状,一个角落完全是圆形的矩形:

但似乎我不能在这个数字中获得“更圆”的角落:

这是为什么? < corner android:radius =“integer”/>?的最大值
当然我可以用png做到这一点,但我认为使用形状更有效率,所以我更喜欢这样.

我的代码:

<button    androID:ID="@+ID/button_guest"    androID:layout_wIDth="315dp"    androID:layout_height="80dp"    androID:background="@drawable/rounded_rectangle"    androID:contentDescription="@string/text_button_guest"    androID:onClick="startGuestMode"    androID:text="@string/text_button_normal"    androID:textAllCaps="false"    androID:textcolor="#ff000000"    androID:textSize="50sp"    androID:layout_marginleft="125dp"    androID:layout_marginStart="125dp"    androID:layout_alignParentleft="true"    androID:layout_alignParentStart="true" />

rounded_rectangle.xml:

<?xml version="1.0" enCoding="utf-8"?><shape xmlns:androID="http://schemas.androID.com/apk/res/androID">    <solID androID:color="#ffffff" />    <corners        androID:radius="40dp" /></shape>

解决方法:

好吧,我喜欢当我刮了几个小时,然后我最终在这里问了一个问题,然后我在不到10分钟的时间里找到了答案:D

解决方案在我的代码中.你会认为它应该具有相同的行为,但显然它没有.关于圆角的可能是另一个错误.

<?xml version="1.0" enCoding="utf-8"?><shape xmlns:androID="http://schemas.androID.com/apk/res/androID">    <solID androID:color="#ffffff" />    <corners        androID:bottomLefTradius="40dp"        androID:bottomrighTradius="40dp"        androID:topRighTradius="40dp"        androID:topLefTradius="40dp"        /></shape>
总结

以上是内存溢出为你收集整理的Android中矩形圆角的最大值全部内容,希望文章能够帮你解决Android中矩形圆角的最大值所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1115699.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存