shouldRasterize
来源:互联网 发布:php会员积分管理系统 编辑:程序博客网 时间:2024/06/04 00:38
@interface ViewController ()@property (nonatomic, weak) IBOutlet UIView *containerView;@end@implementation ViewController- (UIButton *)customButton{ //create button CGRect frame = CGRectMake(0, 0, 150, 50); UIButton *button = [[UIButton alloc] initWithFrame:frame]; button.backgroundColor = [UIColor whiteColor]; button.layer.cornerRadius = 10; //add label frame = CGRectMake(20, 10, 110, 30); UILabel *label = [[UILabel alloc] initWithFrame:frame]; label.text = @"Hello World"; label.textAlignment = NSTextAlignmentCenter; [button addSubview:label]; return button;}- (void)viewDidLoad{ [super viewDidLoad]; //create opaque button UIButton *button1 = [self customButton]; button1.center = CGPointMake(50, 150); [self.containerView addSubview:button1]; //create translucent button UIButton *button2 = [self customButton];  button2.center = CGPointMake(250, 150); button2.alpha = 0.5; [self.containerView addSubview:button2]; //enable rasterization for the translucent button button2.layer.shouldRasterize = YES; button2.layer.rasterizationScale = [UIScreen mainScreen].scale;}@end
0 0
- shouldRasterize
- iOS-self.layer.shouldRasterize属性
- iOS shouldRasterize 详解 是否光栅化
- ios开发中view.layer.shouldRasterize = YES 的使用说明
- ios开发中view.layer.shouldRasterize = YES 的使用说明
- ios开发中view.layer.shouldRasterize = YES 的使用说明
- view.layer.shouldRasterize = YES(光栅化)的使用 及图片性能整理
- markdown画UML图
- 浅析SuperMap iObject .NET开发完成后私有部署,打包安装
- UIImagePickerController的基础用法
- MFC CWnd::OnMove
- 友盟推送使用别名(Alias)推送到具体用户
- shouldRasterize
- java process的waitfor()阻塞问题
- JPUSH服务端集成(JAVA版本)
- Zen Coding: 一种快速编写HTML/CSS代码的方法(已经更名为emmet)
- AtomicInteger的使用,多线程叠加或叠减
- 服务器端编程心得(二)—— Reactor模式
- CXF系列之WSDL文件结构
- MySQL的外键约束:Cascade/Restrict/No action/SET NULL :级联操作
- 时间戳