uiscrollview

Is there a way to put UITextView's scroll indicator to outside UITextView?

夙愿已清 提交于 2020-01-11 02:11:52
问题 It might be a silly question. I'm trying to set left/right margins like the attached picture. I succeeded to implement it by adding UITextView to UIScrollView. However, I could achieve almost everything I want with UITextView alone. For example, with UIScrollView, when I manually change the text of UITextView, it automatically scrolls to bottom regardless of setting its .scrollEnabled to No. It would be perfect if a scroll indicator of UITextView appears outside UITextView. In the attached

How to create a layout like Featured page in App Store?

♀尐吖头ヾ 提交于 2020-01-10 19:41:11
问题 I'm new in iOS development. Based on my assumption, Feature page in App Store was created using a combination of UITableView and UICollectionView. But how to do that in theory and code? I know it's a bit vague, because it's quite hard to describe it, but I just need some people to help me explain it. For this case I will try to use these naming: 1. Top section, it's a view which showing banners of apps, people can swipe it to view another banner. 2. Middle section, views which can be scrolled

XCode 8 - How to solve an Auto resizing issue on XCode version 8.0?

你离开我真会死。 提交于 2020-01-10 19:34:48
问题 I used XCode version 7.2.1 for my project. But I updated the XCode version 8.0 now. Though the scroll view is messed in view controllers of my project. Here I have used Resizing only not an Auto layout. I referred many forums. But can't able to find a solution for that. Here I have attached similar links to what I had tried. Xcode 8 GM seed Storyboard layout issue Layout issues after updating to Xcode 8 I have to update frame of everything in storyboard every time I start Xcode What is the

XCode 8 - How to solve an Auto resizing issue on XCode version 8.0?

只愿长相守 提交于 2020-01-10 19:33:33
问题 I used XCode version 7.2.1 for my project. But I updated the XCode version 8.0 now. Though the scroll view is messed in view controllers of my project. Here I have used Resizing only not an Auto layout. I referred many forums. But can't able to find a solution for that. Here I have attached similar links to what I had tried. Xcode 8 GM seed Storyboard layout issue Layout issues after updating to Xcode 8 I have to update frame of everything in storyboard every time I start Xcode What is the

Programmatically scroll a UIScrollView to the top of a child UIView (subview) in Swift

余生长醉 提交于 2020-01-10 09:26:19
问题 I have a few screens worth of content within my UIScrollView which only scrolls vertically. I want to programmatically scroll to a view contained somewhere in it's hierarchy. The UIScrollView move so that the child view is at the top of the UIScrollView (either animated or not) 回答1: Here's an extension I ended up writing. Usage: Called from my viewController, self.scrollView is an outlet to the UIScrollView and self.commentsHeader is a view within it, near the bottom: self.scrollView

UIScrollView direction of scrolling

守給你的承諾、 提交于 2020-01-09 14:06:52
问题 I would like to copy the effect seen in Pinterest app, where they hide top and bottom bars depending on the direction of scrolling. My question is: what is the correct way to determine which way the UIScrollView is scrolling? 回答1: This is the solution: -(void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { pointNow = scrollView.contentOffset; } -(void)scrollViewDidScroll:(UIScrollView *)scrollView { if (scrollView.contentOffset.y<pointNow.y) { DLog(@"down"); } else if (scrollView

iOS - Using storyboard and autolayout to center the UIScrollView

时光总嘲笑我的痴心妄想 提交于 2020-01-09 09:55:52
问题 I'm creating iOS app using story board and auto layout so that it will work good on both iPhone4 and iPhone5. Below is the screen shot of the view that I'm creating using story board. In the above image, I want to keep the scroll view in the middle from leading edge of superview and the right table view. I dont want the scroll view to increase its width in iPhone5. I tried different combinations of constraints, but I couldn't achieve it. Can some suggest me what are all constraints that I've

Setting up UIScrollView to swipe between 3 view controllers

白昼怎懂夜的黑 提交于 2020-01-09 04:43:27
问题 I am trying to set up a UIScrollView so that I can swipe between my 3 view controllers. This is my code in AppDelegate.m: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch.; UIScrollView *sv = [[UIScrollView alloc] init]; BarsViewController *bvc = [[BarsViewController alloc] init]; // Create

How to get UIScrollView vertical direction in Swift?

柔情痞子 提交于 2020-01-09 03:10:29
问题 How can I get the scroll/swipe direction for up/down in a VC? I want to add a UIScrollView or something else in my VC that can see if the user swipes/scrolls up or down and then hide/show a UIView depending if it was an up/down gesture. 回答1: If you use an UIScrollView then you can take benefit from the scrollViewDidScroll: function. You need to save the last position (the contentOffset ) it have and the update it like in the following way: // variable to save the last position visited,

Disable UIScrollView scrolling when UITextField becomes first responder

99封情书 提交于 2020-01-08 13:55:12
问题 When a UITextField , embedded in a UIScrollView becomes first responder, by lets say the user typing in some character, the UIScrollView scrolls to that Field automatically, is there any way to disable that? Duplicate rdar://16538222 over 回答1: Building on Moshe's answer... Subclass UIScrollView and override the following method: - (void)scrollRectToVisible:(CGRect)rect animated:(BOOL)animated Leave it empty. Job done! 回答2: I've been struggling with the same problem, and at last I've found a