uiscrollview

Use Pan Recognizer to Control ScrollView

本小妞迷上赌 提交于 2020-01-06 07:17:48
问题 I have a scrollView with paging enables. I have a UIView as a subview of the scrollView. When the scrollView reaches the buttom of it's content, I'm turning scrolling off: scrollView.scrollEnabled = false because I'm doing other things that require dragging in a part of the scrollView (Yellow part). So the scrollViews offset locks at the buttom of the page. I want to be able to drag in the UIView (red), to enable scrolling of the scrollView, and thereby change the scrollviews content offset.

Custom UITableViewCell with UIScrollView

纵饮孤独 提交于 2020-01-06 07:08:17
问题 Cell doesn't receive touch events, when there is UIScrollView inside UITableViewCell. Is there any way to cancel tap events for UIScrollView (needs only to handle scrolling)? 回答1: If you need touches to go through, implement a subclass of UIScrollView, and add these: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { // Pass to parent [super touchesBegan:touches withEvent:event]; [self.nextResponder touchesBegan:touches withEvent:event]; } - (void)touchesEnded:(NSSet *)touches

Load childViewController to scrollview parent with a button

扶醉桌前 提交于 2020-01-06 06:58:21
问题 I'm using the PageViewController (https://www.cocoacontrols.com/controls/pageviewcontroller) to create a Magazine App similar to Wired. I've used this code on CustomPagerViewController to load the childview's: - (IBAction)btn_index:(id)sender { NSInteger currentPage = 3; CGPoint offset = CGPointMake(currentPage * self.scrollView.frame.size.width, 0); [self.scrollView setContentOffset:offset animated:YES];} But I need several buttons on the indexviewcontroller to load the correct views and

Not Detecting Tap on image view

ぃ、小莉子 提交于 2020-01-06 04:51:54
问题 I have an application in which i am calling image from URL in image view. Image view is add as subview of scroll view. In my implementation file i have use this code - (void)loadView { [super loadView]; // add gesture recognizers to the image view UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)]; UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleTap:)];

Views in ScrollView doesn't respect constraints

坚强是说给别人听的谎言 提交于 2020-01-06 04:36:16
问题 I added a ScrollView to my View Controller. Then, I created constraints between my inner elements and the scroll view itself, but I don't understand why my yellow view for example is not taking the full width. Here is the screenshot of my view and constraints: And sometimes I get this, why? When I don't use Scroll View, all works perfectly. 回答1: Control drag from the mapView to the outer main View and select Equal-Widths 来源: https://stackoverflow.com/questions/48708331/views-in-scrollview

Zoom Images in Paged UIScrollView

北战南征 提交于 2020-01-06 03:28:29
问题 I am creating a paging UIScrollView following this tutorial. This is the Swift code which allow paging of images with UIScrollView . However, it has a limitation. I am unable to zoom the images. class PagedScrollViewController: UIViewController, UIScrollViewDelegate { @IBOutlet var scrollView: UIScrollView! @IBOutlet var pageControl: UIPageControl! var pageImages: [UIImage] = [] var pageViews: [UIImageView?] = [] override func viewDidLoad() { super.viewDidLoad() // 1 pageImages = [UIImage

scaling UIScrollView contentSize to fit UIView with variable-height UITableView inside

一曲冷凌霜 提交于 2020-01-06 01:48:07
问题 I have a uiview with a uiscrollview as a subview in a nib. Then, I load another uiview with a uitableview as a subview of this other uiview (among other elements inside this view) as a subview of the uiscrollview. That is, UISCrollView -> UIView -> UITableView (and some other views inside the UIView). And I need to do the following: Once I know the final height of the tableview (depending on the number of cells and height of them) I need to resize the uiview containing it and, in turn, resize

scaling UIScrollView contentSize to fit UIView with variable-height UITableView inside

允我心安 提交于 2020-01-06 01:48:07
问题 I have a uiview with a uiscrollview as a subview in a nib. Then, I load another uiview with a uitableview as a subview of this other uiview (among other elements inside this view) as a subview of the uiscrollview. That is, UISCrollView -> UIView -> UITableView (and some other views inside the UIView). And I need to do the following: Once I know the final height of the tableview (depending on the number of cells and height of them) I need to resize the uiview containing it and, in turn, resize

iphone+UIscrollview or to use uitableview to display image in matrix format

拟墨画扇 提交于 2020-01-05 07:06:13
问题 I want to display the image(which comes from webservice) the format such that the output in the screen appears like below image:- Now the logic i had implemented is,i had added the image in uiscrollview. with the below logic:- for (int j=0;j<9;j++) { for (int i=0; i<[mainRestaurantArray count];i++) { if ([[[mainRestaurantArray objectAtIndex:i] valueForKey:@"Image"] isKindOfClass:[UIImage class]]) { [CombineArray addObject:[mainRestaurantArray objectAtIndex:i]]; //NSLog(@"cnt=>%d array==>%@"

Autolayout with UIScrollView

你。 提交于 2020-01-05 05:53:34
问题 I am using autolayout in Xcode and am creating a fairly tall (1300px) ViewController with a uiscrollview to navigate up and down. I made the viewcontroller freeform so its dimensions are [375,1300]. I then incorporated the scrollview, added the content view as well as all the subviews & constrained everything, leaving no constraint errors. At runtime there are no errors, but everything is all smushed into the normal screen size when I intended for it to be very tall (~1300px) and scrollable.