uiview

UIView animation lags on device

北慕城南 提交于 2021-02-08 05:18:35
问题 I'm using animation in my app and get confused, because animation is lagging on device, on simulator everything seems OK. First I tried to use [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.3]; [UIView setAnimationCurve:UIViewAnimationCurveEaseOut]; And before commit animation there were something like ~30 lines of code with "if" blocks so I thought this might cause the problem, but then I start to use [UIView animateWithDuration:0.3 delay:0.0 options:

UIView with transparent in middle

自闭症网瘾萝莉.ら 提交于 2021-02-07 16:18:35
问题 Is it possible to create such a UIView fill with color, but in the middle is transparent? I'm thinking about to create 5 UIView s here. Just wondering is it possible to accomplish by using only ONE UIView 回答1: From Duncan C, I get to know where should I start, then I found CALayer with transparent hole in it. UIBezierPath *overlayPath = [UIBezierPath bezierPathWithRect:self.view.bounds]; UIBezierPath *transparentPath = [UIBezierPath bezierPathWithRect:CGRectMake(60, 120, 200, 200)];

UIView with transparent in middle

牧云@^-^@ 提交于 2021-02-07 16:18:34
问题 Is it possible to create such a UIView fill with color, but in the middle is transparent? I'm thinking about to create 5 UIView s here. Just wondering is it possible to accomplish by using only ONE UIView 回答1: From Duncan C, I get to know where should I start, then I found CALayer with transparent hole in it. UIBezierPath *overlayPath = [UIBezierPath bezierPathWithRect:self.view.bounds]; UIBezierPath *transparentPath = [UIBezierPath bezierPathWithRect:CGRectMake(60, 120, 200, 200)];

UIView with transparent in middle

你离开我真会死。 提交于 2021-02-07 16:13:24
问题 Is it possible to create such a UIView fill with color, but in the middle is transparent? I'm thinking about to create 5 UIView s here. Just wondering is it possible to accomplish by using only ONE UIView 回答1: From Duncan C, I get to know where should I start, then I found CALayer with transparent hole in it. UIBezierPath *overlayPath = [UIBezierPath bezierPathWithRect:self.view.bounds]; UIBezierPath *transparentPath = [UIBezierPath bezierPathWithRect:CGRectMake(60, 120, 200, 200)];

UIView with transparent in middle

纵然是瞬间 提交于 2021-02-07 16:10:04
问题 Is it possible to create such a UIView fill with color, but in the middle is transparent? I'm thinking about to create 5 UIView s here. Just wondering is it possible to accomplish by using only ONE UIView 回答1: From Duncan C, I get to know where should I start, then I found CALayer with transparent hole in it. UIBezierPath *overlayPath = [UIBezierPath bezierPathWithRect:self.view.bounds]; UIBezierPath *transparentPath = [UIBezierPath bezierPathWithRect:CGRectMake(60, 120, 200, 200)];

UIView with transparent in middle

你。 提交于 2021-02-07 16:08:24
问题 Is it possible to create such a UIView fill with color, but in the middle is transparent? I'm thinking about to create 5 UIView s here. Just wondering is it possible to accomplish by using only ONE UIView 回答1: From Duncan C, I get to know where should I start, then I found CALayer with transparent hole in it. UIBezierPath *overlayPath = [UIBezierPath bezierPathWithRect:self.view.bounds]; UIBezierPath *transparentPath = [UIBezierPath bezierPathWithRect:CGRectMake(60, 120, 200, 200)];

UIView with transparent in middle

萝らか妹 提交于 2021-02-07 16:07:52
问题 Is it possible to create such a UIView fill with color, but in the middle is transparent? I'm thinking about to create 5 UIView s here. Just wondering is it possible to accomplish by using only ONE UIView 回答1: From Duncan C, I get to know where should I start, then I found CALayer with transparent hole in it. UIBezierPath *overlayPath = [UIBezierPath bezierPathWithRect:self.view.bounds]; UIBezierPath *transparentPath = [UIBezierPath bezierPathWithRect:CGRectMake(60, 120, 200, 200)];

Get UITextField from UIView using an Identifier/Tag (SWIFT)

↘锁芯ラ 提交于 2021-02-07 07:27:48
问题 I need to know how I can access a particular UITextField within a UIView from the ViewController class. The setup I have currently is that I have ViewController that is linked to a View in Storyboard. I have UIView in nib that has 3 UITextFields. I load the view up using the following code: TextFieldView = UINib(nibName: "TextView", bundle: nil).instantiateWithOwner(nil, options: nil)[0] as! UIView self.view.addSubview(TextFieldView) I can get all three UITextField and their values using the

Shadow on UIView layer

家住魔仙堡 提交于 2021-02-07 06:34:29
问题 I've make a path in order to mask my view: let path = // create magic path (uiview bounds + 2 arcs) let mask = CAShapeLayer() mask.path = path.cgPath view.layer.masksToBounds = false view.layer.mask = mask Up to here all ok. Now I would like to add a shadow that follows path, is it possibile? I try in several way, the last one is: mask.shadowPath = path.cgPath mask.shadowColor = UIColor.red.cgColor mask.shadowOffset = CGSize(width: 10, height: 2.0) mask.shadowOpacity = 0.5 But this produce a

Shadow on UIView layer

我的梦境 提交于 2021-02-07 06:34:04
问题 I've make a path in order to mask my view: let path = // create magic path (uiview bounds + 2 arcs) let mask = CAShapeLayer() mask.path = path.cgPath view.layer.masksToBounds = false view.layer.mask = mask Up to here all ok. Now I would like to add a shadow that follows path, is it possibile? I try in several way, the last one is: mask.shadowPath = path.cgPath mask.shadowColor = UIColor.red.cgColor mask.shadowOffset = CGSize(width: 10, height: 2.0) mask.shadowOpacity = 0.5 But this produce a