uiview

UINavigationController from scratch?

家住魔仙堡 提交于 2020-01-17 03:28:07
问题 I have a view based app that works well. (In other words, I'm not going to start over with a Navigation-Based App template.) It's an immersive app of sorts and I'm trying to add a Table View that loads in a new view when a button is pressed. The loading the nib part works, but I can't seem to be able to add a navigation controller to the new view. I want to see a navigation bar on top with a done button and an edit button. Also, I want to the Table View entries to be empty. I added a new file

convertPoint:fromView: works well on the simulator, not on device

十年热恋 提交于 2020-01-16 19:28:06
问题 I was happy to see this: answer for how to convert point of a subview and it worked perfect for me on the simulator. But for some reason it doesn't work on the device... Can it be that the views positions are differently managed by the device - or is it just another mystery? Or (hopefully) I wrote it wrongly and you guys can help... :) here's my line: CGPoint yoel = [imagePressed.imageView convertPoint:imagePressed.frame.origin toView:nil]; 回答1: I had a different problem that relates to this

convertPoint:fromView: works well on the simulator, not on device

本小妞迷上赌 提交于 2020-01-16 19:27:31
问题 I was happy to see this: answer for how to convert point of a subview and it worked perfect for me on the simulator. But for some reason it doesn't work on the device... Can it be that the views positions are differently managed by the device - or is it just another mystery? Or (hopefully) I wrote it wrongly and you guys can help... :) here's my line: CGPoint yoel = [imagePressed.imageView convertPoint:imagePressed.frame.origin toView:nil]; 回答1: I had a different problem that relates to this

How add a UIButton on every image of image view which is in scroll view?

偶尔善良 提交于 2020-01-16 18:14:21
问题 i have an iPhone app in which i have several images. These images add in image view. That image view add sub view with scroll view. Now i want to add a transparent button on every image. How can i do that? I have shown my code below: - (void)layoutScrollImages{ UIImageView *view = nil; NSArray *subviews = [scrollView1 subviews]; // reposition all image subviews in a horizontal serial fashion CGFloat curXLoc = 0; for (view in subviews) { if ([view isKindOfClass:[UIImageView class]] && view.tag

Move a View into Another view on button click in Swift iOS

人走茶凉 提交于 2020-01-16 07:18:19
问题 I am stumbled upon an issue in an application that i am making. I need to place one view into another view programmatically on button click. Now i need to move View 1 to the centre of View 2 on a button click with an animation. I tried to reposition the View1 to View 2 but i am not able to do it properly. This is the Final result that i am trying to achieve. CODE FOR CREATING THE RED VIEW My.cellSnapshot = snapshopOfCell(cell) var center = cell.center My.cellSnapshot!.center = center My

Applying just the scale component of a CGAffineTransform to a UIView

徘徊边缘 提交于 2020-01-16 07:12:10
问题 I have a UIView to which various scale and rotation CGAffineTransforms have been applied, in response to touch screen gestures. When a scale operation completes, I want to adjust the bounds of the view to the new size, then have view to re-draw itself at a scale of 1.0, while keeping all other components of the transform the same. To adjust the bounds of the view, I'm using: self.myView.bounds = CGRectApplyAffineTransform(self.myView.bounds, self.myView.transform); To "undo" the scale

Applying just the scale component of a CGAffineTransform to a UIView

戏子无情 提交于 2020-01-16 07:11:20
问题 I have a UIView to which various scale and rotation CGAffineTransforms have been applied, in response to touch screen gestures. When a scale operation completes, I want to adjust the bounds of the view to the new size, then have view to re-draw itself at a scale of 1.0, while keeping all other components of the transform the same. To adjust the bounds of the view, I'm using: self.myView.bounds = CGRectApplyAffineTransform(self.myView.bounds, self.myView.transform); To "undo" the scale

bezierPathWithRoundedRect not perfect circle

女生的网名这么多〃 提交于 2020-01-16 06:09:05
问题 I have some problem with draw circle: This simply code demonstrates that: - (void)drawRect:(CGRect)rect { self.layer.sublayers = nil; CGFloat radius = self.frame.size.width/2; circle = [CAShapeLayer layer]; circle.path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.width) cornerRadius:radius].CGPath; circle.fillColor = [UIColor clearColor].CGColor; circle.strokeColor = [UIColor redColor].CGColor; circle.lineWidth = 4; [self.layer addSublayer

Approximate rect after applying CATransform3D?

一曲冷凌霜 提交于 2020-01-16 04:10:07
问题 I applied CATransform3D to a view. How can I find its approximate new frame after it? I mean I applied a complex transform: rotation, translation, scale and perspective. And I need to find something like approximate minimal rect. I need it because this view is added to UIScrollView (to know the contentSize I need and of course to implement "scrollToItem:") 回答1: If you want to get the CGRect that completely contains this transformed view, you can use convertRect:toView: . For example: CGRect

how to make dynamical strokeColor in CAShapeLayer? In Swift

允我心安 提交于 2020-01-16 03:01:49
问题 I use six parameters (as active, inactive, wired, compressed, free and total). I make a class of CAShapeLayer and I made one function in there with help I can draw circle just add parameters. I make CGPath and add it six once in function which draw a circle. I get the 5 layers to UIView . I make timer which update data in one second but it add else 5 layer to UIView . It is wrong way. I want to animate arcs with data and update in one second. when layers become too much device is working