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:]?
基础教程推荐
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- iOS4 创建后台定时器 2022-01-01
