uiscrollviewdelegate

UICollectionView doesn't bounce when datasource has only 1 item

半城伤御伤魂 提交于 2019-12-20 17:32:56
问题 I have a UICollectionView with a custom UICollectionViewFlowLayout. It scrolls horizontally and only shows one item at a time (full height). I have pagingEnabled = YES so that it sticks to pages. The UICollectionView shows photos within a particular day. I initially had buttons to change the day +/- 1 day, but I thought it would be neat if the user could pull on the collection view past the first or last image (past a predetermined threshold) to change the day. I implemented this using the

Manually scrolling two UICollectionViews showing the same content

风格不统一 提交于 2019-12-20 03:55:12
问题 As the title suggest, I have a UIViewController with two UICollectionViews which are displaying the same content in a horizontal fashion. The main one shows one photo at a time, the thumbs one shows several. I have overridden the UIScrollViewDelegate method and added some code so that when the user scrolls the main CV, then the thumbs CV scrolls too. However I would like to enable the opposite as well (scroll the thumbs which will quickly move the main). However i'm getting a feedback effect.

Setting contentOffset programmatically triggers scrollViewDidScroll

痞子三分冷 提交于 2019-12-17 15:19:25
问题 I've got a a few UIScrollView on a page. You can scroll them independently or lock them together and scroll them as one. The problem occurs when they are locked. I use UIScrollViewDelegate and scrollViewDidScroll: to track movement. I query the contentOffset of the UIScrollView which changed and then reflect change to other scroll views by setting their contentOffset property to match. Great.... except I noticed a lot of extra calls. Programmatically changing the contentOffset of my scroll

UIButton inside UIScrollView, inside UIScrollview

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-14 02:25:22
问题 Controller A's view contains a UIScrollview which contains a UIButton. The content scrolls vertically and the button works fine. Controller B's view contains a UIScrollview for paging left and right. When I place my Controller A view inside the scroll view of Controller B's the UIButton stops working. I can't 'de-nest' the scrollviews because they are managed by independent controllers - and paging is only required under certain circumstances. Why does Controller B stop the button from

UIScrollView do not scroll

守給你的承諾、 提交于 2019-12-12 11:56:51
问题 I have a UIScrollView that do not scroll at all. If I enable bouncing, I can scroll far enough to the sides to see that there is content outside of the view, but it snaps right back to the origin when I release. I have paging turned on, but I get the same behavior if I turn it off. I have auto layout turned off. In the IB, the scrollView is in a MainViewController, correctly linked up to the IBOutlet as below. @interface MainViewController () @property (strong, nonatomic) IBOutlet

Parallax UIScrollView – handling two views in one scrollViewDidScroll method?

醉酒当歌 提交于 2019-12-12 04:42:48
问题 I’m creating a basic parallax effect much like the iOS7 app switcher, using two UIScrollView instances ( cardScrollView and tileScrollView ). I scroll one alongside the other, at a different rate, like so: if ([scrollView isEqual:self.tileScrollView]) { [self.cardScrollView setContentOffset:CGPointMake((self.tileScrollView.contentOffset.x + 110) * TILE_CARD_DELTA, self.cardScrollView.contentOffset.y)]; } This works fine when scrolling tileScrollView . However, I’d like the same to work in

Content of UIscrollview not updating, when changing orientation

穿精又带淫゛_ 提交于 2019-12-12 01:05:41
问题 Here's my problem. Am Using a scrollview whose Frames I am changing when rotating the device. I have 8 AsyncImageView on that scrollview. And the Images on AsyncImageView's are set by calling web services. Project runs fine. Images on the AsyncImageView are loaded properly. But when I rotate the device, AsyncImageViews shows no Images . I tried everything. No success. Then I used a trick. That is setting the scrollview content offset 1,0 when rotating in either direction. And my project works

App crashes when tab bar item is selected

空扰寡人 提交于 2019-12-11 12:57:09
问题 I have a tab bar item with a UIScrollView and all the code works. I link the UIScrollView IBOutlet in IB to a UIScrollView I placed in my View. When I run the app and select the tab bar item I get the following error. Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key scrollView.' I have no idea what this is. When I disconnect the ScrollView IBOutlet, then there is no crash. Thanks

Only last image is loading from url in scrollview

谁说我不能喝 提交于 2019-12-11 07:58:51
问题 In my iOS app I have have a lots of view and image and labels are the subviews of the. view. My problem is while loading images from url or remote server only last image is loading from url . Other images are loaded with placeholders. Tried many ways but unable to solve it . My code and screenshot are provided below catScrollView=[[UIScrollView alloc]initWithFrame:CGRectMake(0, 10, self.view.frame.size.width,300)]; catScrollView.contentSize = CGSizeMake(([popularCategoryArray count] * 90)/1.8

How do I make a UIImage fade in and fade out as I scroll?

我的梦境 提交于 2019-12-11 05:06:00
问题 I have a stretchy header that I made following this tutorial http://blog.matthewcheok.com/design-teardown-stretchy-headers/. Anyway it's working perfectly but I'm having trouble making a UIView on top of it fade out as the view stretched and returning to original alpha as the view is returned to normal. Best I could come up with is this: override func scrollViewDidScroll(scrollView: UIScrollView) { updateHeaderView() var offset = scrollView.contentOffset.y if offset < -170 {