iphone - 用 QuartzCore 制作边框很慢?

标签 iphone cocoa-touch ipad uikit quartz-core

当我尝试为 View 添加边框时,我的 View 变得很慢

[self.userView setBackgroundColor:[UIColor whiteColor]];
[self.userView.layer setMasksToBounds:YES];
[self.userView.layer setCornerRadius:15.0f];
[self.userView.layer setBorderColor:[UIColor lightGrayColor].CGColor];
[self.userView.layer setBorderWidth:1.0f];

最佳答案

您可能需要将图层的 shouldRasterize 属性设置为 YES

关于iphone - 用 QuartzCore 制作边框很慢?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10004295/

相关文章:

ios - 我试图从 Crashlytics 找出一个 NSOperationQueue 错误

iphone - 以编程方式卸载 iPhone 应用程序

cocoa-touch - 为什么我的 UITabBar 在纵向加载时向下移动 20 像素?

cocoa-touch - UIRefreshControl 首次运行时标题偏移不正确,有时标题丢失

iphone - 如何从 AVPlayer(不是 AVAudioPlayer)获取持续时间?

iphone - 将 int 转换为 CGFloat

iphone - 常见 UI 字符串的本地化

iphone - 基于 HTML 以编程方式创建 UIImage 和 UILabel

iphone - 如何向推送通知警报 View 添加操作?

ios - 使用 css 从 iPad safari 打印时如何删除或减少边距?