ios中图层的用法(1)
2013-07-14 10:32 甘超波 阅读(639) 评论(0) 编辑 收藏 举报uiview画圆角
- (void)layerMyView { // 圆角 self.myview.layer.cornerRadius = 10; // 边框 self.myview.layer.borderWidth = 5; self.myview.layer.borderColor = [UIColor redColor].CGColor; // 阴影 self.myview.layer.shadowOffset = CGSizeMake(-10, 10); self.myview.layer.shadowColor = [UIColor blueColor].CGColor; self.myview.layer.shadowOpacity = 0.5; }
uiImageview画圆角
// 圆角 // self.imageView.layer.cornerRadius = 30; // // 让内部的所有子层都跟随最外面的边界(这个属性为YES,不能有阴影) // self.imageView.layer.masksToBounds = YES; // // 边框 // self.imageView.layer.borderWidth = 5; // self.imageView.layer.borderColor = [UIColor blueColor].CGColor; // // 阴影 // self.imageView.layer.shadowOffset = CGSizeMake(-10, 10); // self.imageView.layer.shadowColor = [UIColor redColor].CGColor; // self.imageView.layer.shadowOpacity = 0.5;
动画
// 形变 //self.imageView.layer.transform = CATransform3DMakeScale(0.5, 0.5, 0); //self.imageView.layer.transform = CATransform3DMakeRotation(M_PI_4, 1, 1, 0); //[self.imageView.layer setValue:[NSValue valueWithCATransform3D:CATransform3DMakeRotation(M_PI_4, 1, 1, 0)] forKeyPath:@"transform"]; // 搜索CATransform3D [self.imageView.layer setValue:@0.7 forKeyPath:@"transform.scale.x"];
目前我正在专注NLP,请立刻加微信/QQ号 546611623, 免费送你原创《NLP高级执行师》高清视频