uiscrollview

Subclass UIScrollView in Swift for touches Began & touches Moved

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-01 12:12:01
问题 I'm using Swift 1.2 I'm trying to use this UIScrollview touchesbegan,touchesmoved,touchesended actions and the link in the 2nd comment of the accepted answer. I'm using a storyboard with auto layout, I set my custom class for the UIScrollView in Custom Class. I'm not receiving either of these touch events in the UIViewController that contains my custom UIScrollView Edit: Updated my code for how I use it with @Victor Sigler 's answer. Custom ScrollView Code: import UIKit protocol

Subclass UIScrollView in Swift for touches Began & touches Moved

强颜欢笑 提交于 2020-01-01 12:10:03
问题 I'm using Swift 1.2 I'm trying to use this UIScrollview touchesbegan,touchesmoved,touchesended actions and the link in the 2nd comment of the accepted answer. I'm using a storyboard with auto layout, I set my custom class for the UIScrollView in Custom Class. I'm not receiving either of these touch events in the UIViewController that contains my custom UIScrollView Edit: Updated my code for how I use it with @Victor Sigler 's answer. Custom ScrollView Code: import UIKit protocol

UIScrollView is cut off from UITabBarController

∥☆過路亽.° 提交于 2020-01-01 11:55:09
问题 I have a UIScrollView that I place inside of a view (interface builder document .xib/.m/.h), however the lower portion of the UIScrollView is getting clipped and not showing the lower half of itself because of a UITabBarController I have. I implemented the UITabBarController in the appdelegate file, so there is no UITabBarController that is seen in the XIB, however if I place another UITabBarController in the XIB to simulate the one i've already created, I will get two when I test the

iOS 8 AutoLayout scrollview scrolls horizontally on iPhone 6 plus

大兔子大兔子 提交于 2020-01-01 11:39:14
问题 I do have an App for iOS and while adapting all the UI to auto layout an size classes to support the new iPhone 6 and iPhone 6 plus i faced a weird issue... al my scrolls view work fine in iPhone 4s, 5, 5s and 6... in iPhone 6 plus they are not scrolling only vertically but also horizontally... like if the content size of the scroll view where a couple of pixel wider than the view itself (so it move horizontally of a couple of pixel and then it bounce). I do not understand why is this

UIScrollView zoomToRect not zooming to given rect (created from UITouch CGPoint)

匆匆过客 提交于 2020-01-01 09:44:38
问题 My application has a UIScrollView with one subview. The subview is an extended UIView which prints a PDF page to itself using layers in the drawLayer event. Zooming using the built in pinching works great. setZoomScale also works as expected. I have been struggling with the zoomToRect function. I found an example online which makes a CGRect zoomRect variable from a given CGPoint. In the touchesEnded function, if there was a double tap and they are all the way zoomed out, I want to zoom in to

UIScrollView with dynamic content

南楼画角 提交于 2020-01-01 09:33:34
问题 I'm trying to implement a UIScrollView , but every tutorial out there deals with a preset number of items. What I have are multiple UITextField 's, but the number of textfields vary. Basically, as soon as one textField contains text, another empty one appears below it, allowing the user to fill in an unlimited number of textfields. My code creates a new textfield as soon as the user types something into a previous one. The x-coordinates of this is the same as the previous one, but the y

UIGestureRecognizer over UIScrollView

北战南征 提交于 2020-01-01 09:23:17
问题 I need to detect left and right swipe over a UIScrollView with 3 fingers when horizontal scrolling is possible. I need to keep all the interactions with 1 and 2 fingers. Is it possible to do that without rewrite all gesture recognision. Thank you 回答1: It's possible. Add a swipe gesture to your UIScrollView and be sure to implement - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;

Scrolling in a UIScrollView without triggering touchesCancelled

送分小仙女□ 提交于 2020-01-01 08:35:31
问题 Overview I'm working on an iPhone game whose code I inherited from another developer. The gaming grid is a UIScrollView having a contentSize of 1000x1000. The grid contains several elements drawn on the screen via OpenGL's Texture2D class. The UIScrollView scrolls in the direction opposite of that in which your finger is moving. The idea behind this is to simulate the act of "sifting" through the elements with your finger, as each element in the path of your touch is supposed to be affected

Strange UIImageView in UIScrollView

人盡茶涼 提交于 2020-01-01 07:57:53
问题 Very strange behavior, there is a round dot in the center of the screen using this code, and a UIScrollview with nothing inside in a nib. I expect that UIScrollview should be empty. The dot blurs and disappears when I scroll the screen. - (void)viewDidLoad { [super viewDidLoad]; NSArray *subviews = [closetScroll subviews]; UIImageView *strange=[subviews objectAtIndex:0]; strange.center = CGPointMake([[UIScreen mainScreen] bounds].size.width/2, [[UIScreen mainScreen] bounds].size.height/2);

Redraw subviews after UIScrollView zoom

白昼怎懂夜的黑 提交于 2020-01-01 06:45:28
问题 I've got a UIScrollView with a child UIView (CATiledLayer) - then I have a bunch more child views of that view (some of which are UITextViews) After zooming everything is all fuzzy. I have read various articles on the subject and they all seem to indicate that I must handle scrollViewDidEndZooming then 'do some transform stuff, mess with the frame and tweak the content offset'. Please can someone put me out of my misery and explain how this is meant to work. Thanks in advance... 回答1: I had a