uiscrollview

Make a deep copy of a UIView and all its subviews

喜你入骨 提交于 2019-12-21 20:52:53
问题 I need to make a deep copy of a UIView containing several subviews. Please help me figure out how to do this? I've done some searching on google and SO and not found anything that does what I want. Explanation for those who would like to know why: I have an infinitely scrolling UIScrollView where, of course, the contents repeat. Each 'set' of the contents (for example, say 26 UIButtons labeled A-Z) is contained inside one view. This is the view I need to make a deep copy of, so that I can

How much contentOffset changes in UIScrollview for zooming?

做~自己de王妃 提交于 2019-12-21 20:39:19
问题 In UIScrollview, when I scroll/drag, I got changes in scrollview contentOffset which represent how much I had scrolled/dragged in the scrollview. By this way, I have updated the subview of scrollview for scrolling. But, when I zoom the scrollview (using pinch zooming), the contentOffsets of the scrollview is also changed. I do not understand how much contentOffset has changed because I can not relate the changes with zoomScale value. So, is there anyway to know changes in contentOffset for

Setting the content size of my UIScrollView in viewDidLoad/viewWillAppear has no effect - why?

て烟熏妆下的殇ゞ 提交于 2019-12-21 20:06:17
问题 I'm trying to force the content size of my UIScrollVIew when it's container loads. I'm finding this much more difficult than I'd imagine it would be. I've tried setting the content size in both viewDidLoad and viewWillAppear , like so: -(void)viewWillAppear:(BOOL)animated { CGSize newContentSize = CGSizeMake(scrollView.contentSize.width, scrollView.frame.size.height + 80.0); [scrollView setContentSize:newContentSize]; } If I place a breakpoint right after I call setContentSize , I can see

How do I keep a CALayer, sublayer of a CATiledLayer, from changing it's scale after a zoom?

自闭症网瘾萝莉.ら 提交于 2019-12-21 19:52:31
问题 I have a CATiledLayer that is used to display a PDF page (this CATiledLayer is the layer type of my UIView which is a subview of a UIScrollView). I want to add overlay markers on this page. So I add a sublayer to my CATiledLayer. This sublayer again hosts the different marker's layers and acts as a grouping layer. So graphically, I have: (keep in mind that I have multiple markers which are CALayers also, this is ascii art after all) pdf page (CATiledLayer) ---------------------- | CALayer | |

Bounce UIScrollView - hint that there's more

こ雲淡風輕ζ 提交于 2019-12-21 19:44:17
问题 I'm developing an app with a scroll view in it. It's not immediately obvious that there's more content, and there's no scroll indicator (scroll view is paged). So, to give the user a 'hey, there's something down here...', I would like to have the scroll view do a subtle bounce - down then up - on launch. I've tried this: - (void)viewDidLoad .... [NSTimer scheduledTimerWithTimeInterval:0.8 target:self selector:@selector(bounceScrollView) userInfo:nil repeats:NO]; } - (void)bounceScrollView {

Infinite UIScrollView gets strange behavior in iOS4.3 not iOS5

你说的曾经没有我的故事 提交于 2019-12-21 18:15:05
问题 I've implemented an infinite UIScrollView that contains UIViews. When scrolling in iOS5 (simulator and iphone) it works beautifully. But in iOS 4.3 (sim and phone) it kinda goes a bit crazy and scrolls passed more views than it should (about 10-15x more views than in iOS5). And to make it more strange it works as expected if I drag slowly so it doesn't continue scroll after I release. The setup is kinda simple, I extend the UIScrollView class. And add UIView with a width of about 1500pt, in

Adding UIViewcontrollers to UIScrollview

人盡茶涼 提交于 2019-12-21 17:58:29
问题 I am changing the layout of an existing application. There are a series of view which now needs to be added to a scrollview that the users can swipe to move to next screen. I have added the controllers to scrollview using the code below. This code is added in the viewDidLoad of the Viewcontroller which holds the UIScrolliew . int i=1; int width = 0,height=0; for(POTCTask *task in [CommonData tasks]) { UIViewController<TaskViewController> *controller = [TaskViewFactory getTaskViewController:

UIScrollView overrides my subview's pan gesture recognizers

一笑奈何 提交于 2019-12-21 17:24:49
问题 If I have a scrollView with a subview and the subview has a pan gesture recognizer, the scrollView's pan gesture override's the subview's pan. What I want is the opposite, I think, so that is I drag a subview it will pan within the scroll view, yet if I touch another area the scroll view will pan as normal. Is there an easy way to set that up? 回答1: Here's what works for me: UIPanGestureRecognizer *subviewPanRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector

How to use UIGestureRecognizerDelegate?

╄→尐↘猪︶ㄣ 提交于 2019-12-21 15:21:28
问题 My Setup I'm trying to replicate Google Now's card interface. I have a UIView which is a subview of (inside) a UIScrollView . Both are controlled from the same UIViewController . The UIView has a UIPanGestureRecognizer attached to it by the UIViewController . The UIScrollView is used to scroll up and down. The UIPanGestureRecognizer is used to swipe away the UIView . The Problem I can't scroll when I'm touching the UIView (the card) The Question How do I implement UIGestureRecognizerDelegate

How to use UIGestureRecognizerDelegate?

China☆狼群 提交于 2019-12-21 15:21:05
问题 My Setup I'm trying to replicate Google Now's card interface. I have a UIView which is a subview of (inside) a UIScrollView . Both are controlled from the same UIViewController . The UIView has a UIPanGestureRecognizer attached to it by the UIViewController . The UIScrollView is used to scroll up and down. The UIPanGestureRecognizer is used to swipe away the UIView . The Problem I can't scroll when I'm touching the UIView (the card) The Question How do I implement UIGestureRecognizerDelegate