uiscrollview

UIScrollView with Content View

戏子无情 提交于 2020-01-05 03:43:12
问题 I've been trying to create a UIScrollView for user registry but with no success. I'm using auto layout and all of the fields that go inside the scroll view are static. Because of the usual ambiguous height issue, I've added a UIView inside the scroll view, set the constraints to the margins of the scroll view and centered aligned it. After that I added all of the fields inside that Content View, in the storyboard. The content fields have their constraints setup as you would expect, but when I

UIRefreshControl( pull left to right refresh ) concept in UICollectionView horizontally

微笑、不失礼 提交于 2020-01-05 02:51:27
问题 I have a custom horizontal collection view that has 1 row and I want to add pull to refresh functionality which, by default, appears above my row of cells. I would like the user to be able to pull the collection view from left to right to activate the UIRefreshControl. Any ideas? 回答1: For this you need to implement the UIScrollViewDelegate method - (void)scrollViewDidScroll:(UIScrollView *)scrollView { CGPoint offset = scrollView.contentOffset; CGRect bounds = scrollView.bounds; CGSize size =

iOS UIScrollView/UITableView contentOffset gets reset when pushViewControllerAnimated:

元气小坏坏 提交于 2020-01-04 19:58:38
问题 I have a simple UIViewController with a UITableView as its view 's subview . I want to have the option to hide the tableViewHeader of my tableview. This is working fine - I can adjust the content offset with the height of the headerView and its all good. However, when I am to transition to a new VC (by pushing) - during the transition animation the tableView's contentOffset gets reset to {0,0} - essentially showing the header view. Is there a way I can keep the contentOffset of the tableView

iOS UIScrollView/UITableView contentOffset gets reset when pushViewControllerAnimated:

会有一股神秘感。 提交于 2020-01-04 19:58:13
问题 I have a simple UIViewController with a UITableView as its view 's subview . I want to have the option to hide the tableViewHeader of my tableview. This is working fine - I can adjust the content offset with the height of the headerView and its all good. However, when I am to transition to a new VC (by pushing) - during the transition animation the tableView's contentOffset gets reset to {0,0} - essentially showing the header view. Is there a way I can keep the contentOffset of the tableView

UIScrollView not scrolling programmatically in iOS 6 & 7 both

天涯浪子 提交于 2020-01-04 11:03:22
问题 For testing purpose I have create project where I have two scrollview. First scrollview have images that I inserted manually and in second scrollview I have list of buttons (as menu). I have button as right and left to scroll UIScrollView programmatically. After clicking this button I was moving scrollview by setting content size. myCounter.text = [NSString stringWithFormat:@"%d", [myCounter.text intValue] - 1]; CGRect page = CGRectMake(320*([myCounter.text intValue] ), 230, 320, 150);

UIScrollView not scrolling programmatically in iOS 6 & 7 both

穿精又带淫゛_ 提交于 2020-01-04 11:00:09
问题 For testing purpose I have create project where I have two scrollview. First scrollview have images that I inserted manually and in second scrollview I have list of buttons (as menu). I have button as right and left to scroll UIScrollView programmatically. After clicking this button I was moving scrollview by setting content size. myCounter.text = [NSString stringWithFormat:@"%d", [myCounter.text intValue] - 1]; CGRect page = CGRectMake(320*([myCounter.text intValue] ), 230, 320, 150);

How do I preserve the frame of a UIScrollView upon entering foreground?

江枫思渺然 提交于 2020-01-04 06:55:29
问题 This question discusses how to create gaps between views in a UIScrollView. The agreed method is to increase the width of UIScrollView's frame to create gaps between the views which will be scrolled past. However when the scroll view is a subview of a UINavigationController an issue arises. The UINavigationController changes the frame of the UIScrollView after it has been set up in -viewDidLoad . The solution proposed is to alter the frame size in -viewDidAppear , at which point

How can I make the fixed cell at the bottom of the table view in iOS?

杀马特。学长 韩版系。学妹 提交于 2020-01-04 05:37:06
问题 I would like to make a fixed cell at the bottom of the table view in iOS similar to that of leaderboard view of HQ trivia iOS app. Like this: 回答1: To give the impression of a fixed cell, you can simply add a UITableView onto a regular UIViewController , set its constraints so that it consumes the whole view, but stops (for example) 60px from the bottom of the screen. Fill the remaining space with a UIView that has the same UI as the cell ... and thats it, the tableview will scroll, and the

iphone - how to scroll uiscrollview from event touched by uibutton in scrollview

人走茶凉 提交于 2020-01-04 05:35:23
问题 structure UIViewController - UIScrollview - UIButton I'm going to make scrollview can receive button event. So whenever user do scrolling(dragging) on the button, the scrollview react as scrolling itself. I made button down and moved handler with event forwarding like below - (IBAction)buttonTouchedMove:(id)sender withEvent:(UIEvent *)event { [[sender nextResponder] touchesMoved:[event allTouches] withEvent:event]; } - (IBAction)buttonTouchedDown:(id)sender withEvent:(UIEvent *)event { [

XCode: Programmatically enable a symbolic breakpoint?

流过昼夜 提交于 2020-01-03 17:06:19
问题 Is there a way to programmatically enable a breakpoint? Normally I'd use a breakpoint condition, but I need to use a symbolic breakpoint. Specifically, something is changing the contentOffset of my UIScrollView between a call to scrollToIndexPath and a call to reloadData . I'd like to enable the symbolic breakpoint only after the call to scrollToIndexPath . 回答1: Jim Ingham's answer works on a x86 system. For an iOS device I was able to use the method described in this answer to