uiscrollview

Fade bottom of UIScrollView to transparent

一个人想着一个人 提交于 2019-12-29 06:58:46
问题 I have a UIScrollView, and I need the bottom to fade to transparent, so that it does not abruptly cut off the content. The background of the UIScrollView is a custom color. This is what I have so far, but the layer is showing up white, instead of the custom color. This is what I am going for, but only on the bottom. : Here is what I have so far: maskLayer = [CAGradientLayer layer]; CGColorRef firstColor = [UIColor colorWithRed:141 green:211 blue:244 alpha:1.0].CGColor; CGColorRef secondColor

Sensitivity/Scroll speed of UIScrollView with paging

亡梦爱人 提交于 2019-12-29 02:46:31
问题 I want UIScrollView to scroll fast after fast sweep, like this. Although, when paging is turned on, the scroll works one page at a time. Is it possible to scroll fast, when paging is enabled with a flick of a finger without manually implementation using gesture recognizers? 回答1: This is fairly straightforward, however you must implement the paging aspect yourself (which is fairly simple). You don't need gesture recognizers. Swift First, adjust your UIScrollView deceleration rate: scrollView

How to make UIScrollView send scrollViewDidScroll messages during animations

无人久伴 提交于 2019-12-28 18:05:33
问题 When the user manually scrolls through my UIScrollView, the scrollViewDidScroll method of my delegate gets called repeatedly during the animation, with newly updated values of the contentOffset. When I call "[scrollView setContentOffset:320 animated:YES", then the delegate method gets called in the same way. I decided that the normal scroll speed is too fast for the user experience, so enclosed a "[scrollView setContentOffset:320]" in an "animatedWithDuration:" block, as Apple recommends in

How to make UIScrollView send scrollViewDidScroll messages during animations

非 Y 不嫁゛ 提交于 2019-12-28 18:05:08
问题 When the user manually scrolls through my UIScrollView, the scrollViewDidScroll method of my delegate gets called repeatedly during the animation, with newly updated values of the contentOffset. When I call "[scrollView setContentOffset:320 animated:YES", then the delegate method gets called in the same way. I decided that the normal scroll speed is too fast for the user experience, so enclosed a "[scrollView setContentOffset:320]" in an "animatedWithDuration:" block, as Apple recommends in

Adding a header view to a UIWebView similar to Safari and Articles

穿精又带淫゛_ 提交于 2019-12-28 08:09:08
问题 I'd like to add a header view to an UIWebView similar to the address/search bar in MobileSafari and the excellent Articles.app by Sophia Teutschler. More precisely, I'd like to create a "pull to fix orientation" view above a UIWebView, just like in Articles. Articles does use a UIWebView, so it seems to be possible. Is there a way to accomplish this without having to embed the UIWebView into a UIScrollView and updating its size all the time, as described in this article? Apparently, I do need

UIScrollView prevents touchesBegan, touchesMoved, touchesEnded on view controller

随声附和 提交于 2019-12-28 05:31:47
问题 I am handling touches for a couple of my UI components in my view controller (custom subclass of UIViewController). It has methods touchesBegan:withEvent: , touchesMoved:withEvent: , and touchesEnded:withEvent: . It was working fine. Then I added a scroll view (UIScrollView) as the top view in the hierarchy. Now my touch handlers on the view controller don't work. They don't get called. The interesting thing is, I have various other UI components within the scroll view that do work. Some are

Why is UIScrollView leaving space on top and does not scroll to the bottom

耗尽温柔 提交于 2019-12-28 02:49:10
问题 I am new to objective-C programming. I am using UIScrollView with some labels, image and text view on it. I have turned off Autolayout and already tried with "Adjust scroll View Insets" on (situation described in title) and off (doesn't scroll). This is what I insert into viewDidLoad: [scroller setScrollEnabled:YES]; [scroller setContentSize:CGSizeMake(320, 687)]; But I must be missing something very simple. 回答1: 1... Why is UIScrollView leaving space on top With Storyboard - Goto view

iPhone UIScrollView Speed Check

↘锁芯ラ 提交于 2019-12-28 02:25:11
问题 I know how to get the contentOffset on movement for a UIScrollView, can someone explain to me how I can get an actual number that represents the current speed of a UIScrollView while it is tracking, or decelerating? 回答1: Have these properties on your UIScrollViewDelegate CGPoint lastOffset; NSTimeInterval lastOffsetCapture; BOOL isScrollingFast; Then have this code for your scrollViewDidScroll: - (void) scrollViewDidScroll:(UIScrollView *)scrollView { CGPoint currentOffset = scrollView

Is it possible for UIStackView to scroll?

社会主义新天地 提交于 2019-12-28 01:38:12
问题 Let's say I have added more views in UIStackView which can be displayed, how I can make the UIStackView scroll? 回答1: In case anyone is looking for a solution without code , I created an example to do this completely in the storyboard, using Auto Layout. You can get it from github. Basically, to recreate the example (for vertical scrolling): Create a UIScrollView , and set its constraints. Add a UIStackView to the UIScrollView Set the constraints: Leading , Trailing , Top & Bottom should be

Designing inside a scrollview in xcode 4.2 with storyboards

别等时光非礼了梦想. 提交于 2019-12-27 20:08:27
问题 I have a vertically scrolling uiscrollview - imagine an 'about this app' page of a tab bar app which goes on a bit and requires a scrollview. It only contains a few images, a video and some text (only the video has been coded in - the rest have been placed in the GUI). In storyboard (Interface Builder?) Xcode 4.2, everything is set up as it should be and works fine, but the view is only as large as what you see on the screen, is it not possible to manually arrange in storyboard the items that