uiscrollview

The zoom for uiscrollview isn't working

主宰稳场 提交于 2019-12-31 05:14:07
问题 I don't understand why the scrollview isn't working, because I followed advices from tutorials. I created the UIScrollView that contains an UIImageView and I also added the method - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView { return imgv; } and the UIScrollViewDelegate in the interface, but it isn't working. Here is the code for the UIScrollView : imgv = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 1000, 500)]; imgv.image = [UIImage imageWithData:retrievedData];

Adding a view to a scroll view that will stretch to fill available width

非 Y 不嫁゛ 提交于 2019-12-31 02:59:06
问题 I am using Auto Layout in a storyboard, no code, and am having difficulties in getting the view inside the scroll view's content view to stretch to fill the device width. I understand the issue is an ambiguous scroll view width, but I'm not sure how to make it non-ambiguous when I want it to always stretch to fill available width (with some padding). In a view controller, I added a scroll view with 4 constraints: top, bottom, leading, trailing to superview. I added a view to the scroll view

iOS UIScrollView Lazy Loading

落爺英雄遲暮 提交于 2019-12-30 13:56:11
问题 i was just wondering if someone could explain this code for me so i can actually learn from it. I am trying to make my app have a scroller that scrolls left to right with loads of pictures (from internet) but the thing is, it must have lazy loading. so i did some tutorials and figured out how to do it but i truly don't understand it. So i was hoping some kind soul would explain how to lazy load step by step This is the code i had learned from the tutorials: -(void)scrollViewDidScroll:

Disable UIPageViewController bouncing - Swift [duplicate]

你离开我真会死。 提交于 2019-12-30 06:35:26
问题 This question already has answers here : Disable UIPageViewController bounce (9 answers) Closed 2 years ago . I've been making a sample app with scrolling between UIViewControllers but the point is i want to disable the bouncing effect at the end of scrolling and when going back to the first UIViewController . here is my code : class PageViewController: UIPageViewController,UIPageViewControllerDataSource, UIPageViewControllerDelegate{ var index = 0 var identifiers: NSArray = [

iPhone: What gets called after viewDidLoad before viewWillAppear?

只愿长相守 提交于 2019-12-30 06:05:41
问题 Really strange behaviour here. I've got a view with a scroll view inside, which contains my interface. In my viewDidLoad , I set the frame of my scrollView to have an origin of 0,0. I log the origin at the end of my viewDidLoad , and it's 0. However, at the start of my viewWillAppear , the origin is -20. Does anyone know what kind of method could get called that would do this? Thanks in advance 回答1: If you want to find out what it could be, you can try registering your view for key value

UIScrollView not scrolling although contentSize is smaller than UIImageView

丶灬走出姿态 提交于 2019-12-30 04:43:05
问题 So I have a UIImageView as a subview of UIScrollView , I've set the contentSize to be smaller than the UIImageView width and height, however it doesn't allow me to scroll.. why is this? Here's some code: UIImage * image = [UIImage imageWithData:data]; UIImageView * imgView = [[UIImageView alloc] initWithImage:image]; [imgView setUserInteractionEnabled:YES]; //[imgView setContentMode:UIViewContentModeScaleAspectFill]; [imgView setBackgroundColor:[UIColor clearColor]]; [imgView

UIScrollView AutoLayout Vertical Only

为君一笑 提交于 2019-12-30 03:41:39
问题 I want to get the AutoLayout working with the UIScrollView and am having a little trouble with it. Here is what I did: Add a UIScrollView inside the Main View with frame: [top: 0, left: 0, width: 320, height: 568] Add UIView "ContentView" inside the UIScrollView with frame and bgcolor black: [top: 0, left: 0, width: 320, height: 568] Setup UIScrollView constraints: [top: 0, bottom: 0, left: 0, right: 0] Setup "ContentView" constraints: [top: 0, bottom: 0, left: 0, right: 0] Align the items

iOS UIScrollView cancel UIButton touch on scroll

末鹿安然 提交于 2019-12-30 02:31:05
问题 I have some UIButtons within a UIScrollView, but I do not want to delay the button touches. However, as soon as the scroll view detects a drag/scroll, I want to cancel the UIButton touch and proceed with the scrolling of the UIScrollView. I have included the following... _scrollView.delaysContentTouches = NO; ...but (obviously) the button touch does not cancel when dragged. Does anyone have any suggestions as to how I can implement this functionality? 回答1: You can override this method of

Bounds automatically changes on UIScrollView with content insets

ⅰ亾dé卋堺 提交于 2019-12-30 02:19:06
问题 I'm using a UIScrollView as my paging scroll view, pagesScrollView . Inside that, I put individual UIScrollViews which are used exclusively for zooming. Inside each of those, I have one view which is the page item which should be zoomable. All of that is inside a UINavigationController with a translucent navbar. My pagesScrollView has contentInset.top = 64 and bounds.origin.y = -64 (that seems weird to me, but that's what the system is setting automatically for me), and this works just fine.

How to Cancel Scrolling in UIScrollView

守給你的承諾、 提交于 2019-12-30 00:37:10
问题 I use UIScrollView to make large-sized (larger than 320px) UI on iPhone. I made an instance of UIScrollView and added some subviews on it. The problem is that I want to enable scrolling only when user touches outside of subviews, stop scrolling when user touches one of subviews. I read documents and tried to find samples but I can't find good hint. If you have any idea, please help me. 回答1: If you want to detect touches inside any of the subviews of the UIScrollView, you will have to subclass