uiscrollview

scrollViewWillEndDragging:withVelocity:targetContentOffset: not working on the edges of a UISCrollView

牧云@^-^@ 提交于 2020-01-20 20:06:45
问题 I'm trying to implement a custom tab bar which is scrollable and has paging at each tab bar item. For that i'm using the delegate scrollViewWillEndDragging:withVelocity:targetContentOffset: which works perfectly with one problem. The way my paging works is, if the contentOffset is near the right item, it the targetContentOffset changes to the offset of that item. Same thing for the left side. The problem is, whenever I'm at at the left half of the first item and the right of the last (the

scrollViewWillEndDragging:withVelocity:targetContentOffset: not working on the edges of a UISCrollView

倾然丶 夕夏残阳落幕 提交于 2020-01-20 20:06:29
问题 I'm trying to implement a custom tab bar which is scrollable and has paging at each tab bar item. For that i'm using the delegate scrollViewWillEndDragging:withVelocity:targetContentOffset: which works perfectly with one problem. The way my paging works is, if the contentOffset is near the right item, it the targetContentOffset changes to the offset of that item. Same thing for the left side. The problem is, whenever I'm at at the left half of the first item and the right of the last (the

how to set scrollview content size with auto layout?

回眸只為那壹抹淺笑 提交于 2020-01-20 07:43:55
问题 I have one screen where I have added 1 scroll view on self view. Tab bar and navigation bar both are there and for iPhone 4 view height is 455.I have added more content on scroll view.the height of scroll view and self view is same.but when i am unable to set content size for scroll view.even i set too it is not working.Please help me. Thanks 回答1: Here is how to set up the size of the contentView in Auto Layout: Add a view to your scrollView. This should be the only top level view on your

How to know exactly when a UIScrollView's scrolling has stopped?

青春壹個敷衍的年華 提交于 2020-01-19 04:46:26
问题 In short, I need to know exactly when the scrollview stopped scrolling. By 'stopped scrolling', I mean the moment at which it is no longer moving and not being touched. I've been working on a horizontal UIScrollView subclass (for iOS 4) with selection tabs in it. One of its requirements is that it stops scrolling below a certain speed to allow user interaction more quickly. It should also snap to the start of a tab. In other words, when the user releases the scrollview and its speed is low,

UIPageControl + circular (Infinite) scrolling

青春壹個敷衍的年華 提交于 2020-01-17 03:18:25
问题 I am working on app in which i have to make welcome screen. In that UIPageControl i need to display different 9 subviews. Also need infinite circular scrolling in that. It means after page-9 if i slide than page-1 should appear. I have tried so much to implement it but never got expected results. Can anyone help me out to get the best solution for it. Thanks. 回答1: I recommended to use iCarousel for doing this task. I do following changes in to there demo Buttons Demo .h class @property

Resize content view in UIScrollView no working

放肆的年华 提交于 2020-01-17 03:01:27
问题 I have this ViewController : Main View _-Scroll __- content view I need to resize dynamically the content view I have this method resizeScrollView(), this is my method : private func resizeScrollView(){ self.mViewContainer.frame.size.height = 800 self.mScrollView.contentSize = self.mViewContainer.frame.size NSLog("Scroll Height : " + NSNumber(float: Float(self.mScrollView.contentSize.height)).stringValue) NSLog("Container Height : " + NSNumber(float: Float(self.mViewContainer.frame.height))

How add a UIButton on every image of image view which is in scroll view?

偶尔善良 提交于 2020-01-16 18:14:21
问题 i have an iPhone app in which i have several images. These images add in image view. That image view add sub view with scroll view. Now i want to add a transparent button on every image. How can i do that? I have shown my code below: - (void)layoutScrollImages{ UIImageView *view = nil; NSArray *subviews = [scrollView1 subviews]; // reposition all image subviews in a horizontal serial fashion CGFloat curXLoc = 0; for (view in subviews) { if ([view isKindOfClass:[UIImageView class]] && view.tag

How to reference video in custom data model for AVPlayer

守給你的承諾、 提交于 2020-01-16 17:06:28
问题 I've managed to reference images for my custom data model which is used to show unique cells their different information. I've been able to do it for images, as it's a lot easier, I just have no clue how to do it for videos. My data model looks like this: fileprivate let data = [ CustomData(title: "Test", image: #imageLiteral(resourceName: "ss-1"), url: "this-will-be-a-local-url-in-cache-to-a-video"), CustomData(title: "Test2", image: #imageLiteral(resourceName: "done-button"), url: "this

How to reference video in custom data model for AVPlayer

社会主义新天地 提交于 2020-01-16 17:03:20
问题 I've managed to reference images for my custom data model which is used to show unique cells their different information. I've been able to do it for images, as it's a lot easier, I just have no clue how to do it for videos. My data model looks like this: fileprivate let data = [ CustomData(title: "Test", image: #imageLiteral(resourceName: "ss-1"), url: "this-will-be-a-local-url-in-cache-to-a-video"), CustomData(title: "Test2", image: #imageLiteral(resourceName: "done-button"), url: "this

Why aren't my videos showing in cells in my scroll view with AVPlayer

↘锁芯ラ 提交于 2020-01-16 08:27:13
问题 I know my code isn't efficient as of yet, I just want it to work really before I optimise it. Basically I have a function FeaturedPostsManager.shared.getFeaturedPosts to get videos from my server and store it in the app's cache and store the local url to the video. Which in my code I do it twice for two different videos, so I have two urls that go to two different videos. I then add them urls in my custom data array for my scroll view to unwrap for each cell and add it's respective video to