uiscrollview

Make static UIView sticky when UIScrollView is scrolling

…衆ロ難τιáo~ 提交于 2019-12-12 16:28:59
问题 I've got a scroll view (diagram: words) that is much longer than the device height At the bottom of the scroll view is some bottom content (diagram: french press) with a different background colour. To separate the bottom content from the words, I've created a 1pt high UIView to act as a border (diagram: red line) I have a button that sits on the bottom of the device, outside the scroll view (the scroll view is device.height - button.height ). This button's background colour matches the

Add UIPageControl to UIScrollView

天涯浪子 提交于 2019-12-12 16:06:18
问题 I have a UIScrollView containing 5 images. I want to add a UIPageControl at the bottom of my scroll view so that the user can see what page they are on. Here is my code for the scroll view: self.helpScrollView.contentSize = CGSizeMake(320 * 5, 436); UIImageView *image1 = [[UIImageView alloc] initWithFrame:CGRectMake(320 * 0, 0, 320, 436)]; image1.image = [UIImage imageNamed:[NSString stringWithFormat: @"Guide Page One.png"]]; [self.helpScrollView addSubview:image1]; UIImageView *image2 = [

How to optimize UIScrollView with large numbers of images

混江龙づ霸主 提交于 2019-12-12 15:41:42
问题 I load all images in UIScrollView at one time,I know it is bad way,so is there any better way to optimize it? 回答1: - (void)scrollViewDidScroll:(UIScrollView *)scrollView { int currentPage = (scrollView.contentOffset.x / scrollView.frame.size.width); // display the image and maybe +/-1 for a smoother scrolling // but be sure to check if the image already exists, you can // do this very easily using tags if ([scrollView viewWithTag:(currentPage + 1)]) { return; } else { // view is missing,

Issues with map behind UIView, similar to FourSquare venue detail

落爺英雄遲暮 提交于 2019-12-12 15:28:28
问题 I am currently using this excellent solution from @yonel to make something similar to the FourSquare venue detail page. Within my storyboard I have this: The problem is: because the scroll is a bit laggy, when I scroll fast I get a "Received memory warning." message in my console. The curious thing is that if I remove all of the labels and buttons inside the UIView (just below the Map View ), everything works fine. Any idea what could be wrong? 回答1: As the above posters mentioned, it is

How to make UIStackView scroll with UIScrollView programmatically?

耗尽温柔 提交于 2019-12-12 15:22:56
问题 I have seen several solutions to make UIStackView scroll with UIScrollView but they all rely Autolayout and IB. Is there a way to do it programmatically? I have seen this example: https://gist.github.com/twostraws/a02d4cc09fc7bc16859c But it uses Visual Format Language and I am using the Layout Anchor API. The layout anchor API: view.leadingAnchor.constraintEqualToAnchor(otherview.topAnchor).active = true 回答1: You can try ScrollableStackView : https://github.com/gurhub/ScrollableStackView

Make scrollbars always visible in uiscrollview [duplicate]

不羁岁月 提交于 2019-12-12 15:12:58
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: UIScrollView - showing the scroll bar How to make scrollbars always visible in uiscrollview . I used the flashscrollindicators it does not make any sense. I used this code to enable scroll indicator hscroll.showsHorizontalScrollIndicator=YES; but the scrollbars are visible only after I start scrolling the uiscrollview . I want to make the scrollbars always visible in uiscrollview 回答1: You can flash them but

UIButton is not working/Clickable in UIScrollView

邮差的信 提交于 2019-12-12 15:08:33
问题 I am using auto layout with UIScrollView . Main UIView Height = 1300 ContentView (within UIScrollBar ) UIView = 1100 The ConetntView contains a button at the bottom. It is completely visible but when I click it, it does not work. Constraints are : 1) ScrollView leading, trailing, top & bottom with main UIView 2) ContantView leading, trailing, top & bottom with UIScrollView 3) Equal height constraint between ContentView & main UIView Please help. 回答1: So, according to your comment this is

UIScrollView tends to “snap” back to a previous position

蹲街弑〆低调 提交于 2019-12-12 15:06:07
问题 I'm using a UIScrollerView and I found that it tends to "snap" back to a previous position when I scroll it. I would like to simulate the behavior if the UItableView's scroller, that stays in the position where the user released his finger. The properties set: [scroller setCanCancelContentTouches:NO]; scroller.clipsToBounds = YES; [scroller setScrollEnabled:YES]; scroller.userInteractionEnabled = YES; scroller.alwaysBounceHorizontal = YES; scroller.alwaysBounceVertical= NO; scroller

Problem with UIScrollView Content Offset

醉酒当歌 提交于 2019-12-12 13:38:19
问题 Im developing an iPad app in which I have a scrollview, the size of which i determine dynamically depending on the number of objects i display in it. Now, though i have not set any content offset I find that the scroll view has been offset by some amount whenever the view loads. When I check the value of the offset, it shows 0. I dont understand why without having a contentOffset value, the scrollview behaves that way. Any reasons for this? I suspect this has something to do with iOS 4.2 as i

In photoscroller app (iPhone WWDC-104 Photos App) uiscrollview images shift to right when called using presentModalviewController

你说的曾经没有我的故事 提交于 2019-12-12 13:24:01
问题 I have seen the WWDC-104 video showing UIScrollView for photos. I have downloaded the Sample code too. In my app the Structure is as follows, (Root Class)Class A ---> Class B -----------> PhotoViewController(Containing ScrollView) I am calling the PhotoViewController class by using presentModalViewController method in Class B. But with every swipe the new Image shifts to right on the view. A black vertical strip is visible on left of the image which widens with each swipe. So after 6 to 8