为什么CGSize类型的cornerRadii参数在-[UIBezierPath bezierPathWithRoundedRect:byRoundingCorners:cornerRadii:]? [英] Why is cornerRadii parameter of CGSize type in -[UIBezierPath bezierPathWithRoundedRect:byRoundingCorners:cornerRadii:]?

查看:24
本文介绍了为什么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:]?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆