uiscrollview

Manually scrolling two UICollectionViews showing the same content

风格不统一 提交于 2019-12-20 03:55:12
问题 As the title suggest, I have a UIViewController with two UICollectionViews which are displaying the same content in a horizontal fashion. The main one shows one photo at a time, the thumbs one shows several. I have overridden the UIScrollViewDelegate method and added some code so that when the user scrolls the main CV, then the thumbs CV scrolls too. However I would like to enable the opposite as well (scroll the thumbs which will quickly move the main). However i'm getting a feedback effect.

iOS setContentOffset not working on ipad

吃可爱长大的小学妹 提交于 2019-12-20 03:27:03
问题 This is really strange. I have a scrollview that contains a three images, and the user swipes to see the next image. However, I want the first screen to start at the middle image. Easy; I'll use setContentOffset and all will be fine. The code works on the iPhone simulator, but not on the iPad simulator (or device!) CGRect screen = [[UIScreen mainScreen] bounds]; CGFloat height = CGRectGetHeight(screen); CGFloat width = CGRectGetWidth(screen); CGPoint rightOffset = CGPointMake(width, 0);

iOS AutoLayout issue with ScrollView

怎甘沉沦 提交于 2019-12-20 03:26:21
问题 Hello i have an auto layout issue with UIScrollView and ModalViewController . Here are my coding steps as sample code: 1) I have an UIViewController with an UIScrollView as subView UIViewController *viewController = [[UIViewController alloc] init]; UIScrollView *scrollView = [[UIScrollView alloc] init]; scrollView.translatesAutoresizingMaskIntoConstraints = NO; [viewController.view addSubview:scrollView]; UIView *superView = viewController.view; NSDictionary *viewsDict =

how to move one direction in UIScrollView when scrolling

不问归期 提交于 2019-12-20 02:42:30
问题 I'm new in objective-c. I create UIScrollView object and add in my view with this code: height = self.view.frame.size.height; width = self.view.frame.size.width; scrollbar = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, width, height)]; scrollbar.delegate = self; scrollbar.backgroundColor = [UIColor whiteColor]; scrollbar.maximumZoomScale = 1.0; scrollbar.minimumZoomScale = 1.0; scrollbar.clipsToBounds = YES; scrollbar.showsHorizontalScrollIndicator = YES; scrollbar.pagingEnabled = YES

the scrollview is not scrolling at xib file

帅比萌擦擦* 提交于 2019-12-20 02:23:44
问题 I am new in iphone development.. I have added the scrollview in my app and added 10 buttons graphically inside the scrollview. but when I run the scrollview is not scrolling my code is as follow - (void)viewDidLoad { [super viewDidLoad]; [scrollview setContentSize:CGSizeMake(1500,50)]; [scrollview setBackgroundColor:[UIColor blackColor]]; [self.view addSubview:scrollview]; } 回答1: It looks like you are taking scrollview in xib. So, you need to remove [self.view addSubview:scrollview]; from

the scrollview is not scrolling at xib file

折月煮酒 提交于 2019-12-20 02:23:41
问题 I am new in iphone development.. I have added the scrollview in my app and added 10 buttons graphically inside the scrollview. but when I run the scrollview is not scrolling my code is as follow - (void)viewDidLoad { [super viewDidLoad]; [scrollview setContentSize:CGSizeMake(1500,50)]; [scrollview setBackgroundColor:[UIColor blackColor]]; [self.view addSubview:scrollview]; } 回答1: It looks like you are taking scrollview in xib. So, you need to remove [self.view addSubview:scrollview]; from

UIImageView zoom and pinch in UIScrollView

≯℡__Kan透↙ 提交于 2019-12-19 11:57:10
问题 I have tried many different ways of implementing expand image and pinch to zoom. I have found tutorials on how to do this with images saved in my project however I am retrieving my images from Firebase. I would like one image to take about half the ProfileViewController screen and the other pictures to be able to be expanded full page and also have the ability to zoom. My code I have for it now does this however the zooming and the position is not clean or easy to use. var newImageView:

Stop a UITableView from automatically scrolling

[亡魂溺海] 提交于 2019-12-19 11:45:12
问题 I have a UITableView that I'm autoscrolling with setContentOffset . Like so: CGFloat point = self.table.tblMinutes.contentSize.height - self.table.tblMinutes.bounds.size.height; [self.table.tblMinutes setContentOffset:CGPointMake(0, point) animated:false]; [self.table.tblMinutes layoutIfNeeded]; [UIView animateWithDuration:20.0 delay:0 options:UIViewAnimationOptionCurveLinear animations:^{ [self.table.tblMinutes setContentOffset:CGPointMake(0, point - 500) animated:false]; } completion:nil];

UitextField resignFirstResponder does not work in scroll view

旧巷老猫 提交于 2019-12-19 11:35:26
问题 I have 2 functions to resignFirstResponder but neither of them works when the textfields are in scrollview my functions: -(BOOL)textFieldShouldReturn:(UITextField *)theTextField { if (theTextField == textField1) { [textField1 resignFirstResponder]; } if (theTextField == textField2) { [textField2 resignFirstResponder]; } if (theTextField == textField3) { [textField3 resignFirstResponder]; } return YES; } - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [

UIScrollView scrolling only with one finger

牧云@^-^@ 提交于 2019-12-19 11:14:35
问题 iOS7 & iOS8 I need to disable 2 or three fingers scrolling in UIScrollview . I tried : [self.scrollView.panGestureRecognizer setMaximumNumberOfTouches:1]; [self.scrollView.panGestureRecognizer setMinimumNumberOfTouches:1]; But it has no effect. It is still possible to scroll with 2 fingers. If i tried to set max and min to 2. One finger scrolling was disabled but 3 fingers scrolling possible :( I tried this too, but without success: for (UIGestureRecognizer* pan in self.scrollView