Why is cornerRadii parameter of CGSize type in -[UIBezierPath bezierPathWithRoundedRect:byRoundingCorners:cornerRadii:]?(为什么CGSize类型的cornerRadii参数在-[UIBezierPath bezierPathWithRoundedRect:byRoundingCorners:cornerRadii:]?)
问题描述
我想不通……我在玩
-[UIBezierPath bezierPathWithRoundedRect:byRoundingCorners:cornerRadii:]
这样:
bezierPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(10, 10, 80, 80)
byRoundingCorners:(UIRectCornerBottomLeft)
cornerRadii:CGSizeMake(20, 20)];
它按预期工作.但是,如果我用 cornerRadii:CGSizeMake(20, 5)
或 CGSizeMake(20, 40)
替换cornerRadii:CGSizeMake(20, 20),则没有区别.
And it works as expected. But if I replace cornerRadii:CGSizeMake(20, 20) with, say, cornerRadii:CGSizeMake(20, 5)
or CGSizeMake(20, 40)
, there's no difference.
为什么cornerRadii是CGSize
而不是CGFloat
呢?CGSize.height
是干什么用的?
Why is cornerRadii CGSize
and not CGFloat
then? What is CGSize.height
for?
任何想法和建议将不胜感激:)
Any ideas and advice will be greatly appreciated :)
推荐答案
好吧,经过进一步测试,我终于发现它似乎是一个iOS 7的错误.正如预期的那样,iOS 6 模拟器上的相同代码可以正确绘制.但是,iOS 7 模拟器和 iOS 7 设备都有这个问题,并且绘制不正确.
Well, after further tests I finally found that it seems to be an iOS 7 bug. The same code on iOS 6 simulator draws properly, as expected. however, both iOS 7 simulator and iOS 7 device have this issue and draw improperly.
我将提交错误报告,除非有人证明我错了并且我缺少某些东西.
I'll file a bug report, unless someone proves me wrong and there is something I am missing.
这篇关于为什么CGSize类型的cornerRadii参数在-[UIBezierPath bezierPathWithRoundedRect:byRoundingCorners:cornerRadii:]?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:为什么CGSize类型的cornerRadii参数在-[UIBezierPath bezierPathWithRoundedRect:byRoundingCorners:cornerRadii:]?


- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01