uiscrollview

UIScrollView or UICollectionView to swipe through images in order called from firebase?

*爱你&永不变心* 提交于 2019-12-11 04:27:16
问题 My app is has a feature in which you answer questions about people you are following, such as (Option A, B, C, D are where the names for the users will be): The idea is that you answer a question about a user and it randomly shuffles from the people you are following from the firebase database. The images are the profile pictures that a user uploads when signing up and they are shown in order from the top left, top right, bottom left, bottom right of whoever is in the answer of the question.

Make UIScrollView work only on content part, not “sides”

泄露秘密 提交于 2019-12-11 04:17:41
问题 Here's a scroll view (it is the GRAY area). Content area is yellow. Notice it insets, so that you can scroll the sides of the content over to the middle of the screen. PROBLEM: you can put your finger on the GRAY area and scroll it. I want it to work so that you can ONLY scroll by putting your finger on the yellow content. If you put your finger on the gray "background" and try to scroll it, nothing should happen. How to do this? Yellow content is scrolled fully to the right, it rests here:

Several UICollectionViews Scroll Horizontally like iBooks

前提是你 提交于 2019-12-11 04:17:24
问题 I am trying to do a view that contains several collectionViews . Swiping left or right would scroll to another collectionView . I have added a scrollView as a first step with paging enabled . I also set the content size to the number of pages. int nb_of_items = 10; // Scroll view for (int i=0; i< nb_of_items ; i++) { CGRect frame = CGRectMake(_scrollView.frame.size.width * i, 0, _scrollView.frame.size.width, _scrollView.frame.size.height); _collectionView.frame = frame; [_scrollView

Swift - Parallax Header View - ScrollView overlap cells

試著忘記壹切 提交于 2019-12-11 04:10:04
问题 I am trying to custom a extension for Parallax Header. However, it's not working perfectly. The table header view always floats and overlaps cells. Extension code: extension UITableView { func addImageHeaderView(headerView headerView: UIView, height: CGFloat) { self.contentInset = UIEdgeInsetsMake(height, 0, 0, 0) self.contentOffset = CGPoint(x: 0, y: -height) self.tableHeaderView = headerView self.tableHeaderView?.frame = CGRect(x: 0, y: 0, width: self.bounds.width, height: height) } func

Get touch points in UIScrollView through UITapGestureRecognizer

落花浮王杯 提交于 2019-12-11 03:28:32
问题 i am using UIScrollview and UITapGestureRecognizer for getting touch event. Now, i want x and y coordinates for my touch position. any help Please? 回答1: In your gesture recognizer handler: CGPoint location = [gestureRecognizer locationInView:gestureRecognizer.view]; you could specify a different view, if you need it. or u can use this also It belongs in a View rather than ViewController, and would look something like this: -(void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)evt { UITouch

UITextView keep scrolling after every new line is inserted, so the lines are invisible (iPhone OS)

本秂侑毒 提交于 2019-12-11 03:19:48
问题 I have UITextView and a situation that is problematic. I write line of text in the UITextView, and then press return for new line. What happen is, the line that i entered is moving up so i can't see it, and i am able to continue writing. This is bad behavior for me, because i need the line to stay, and only move up when i reach the bottom of the UITextView. I've read other similar posts but they wasn't helpfull. Is someone familiar with this thing? 回答1: I had luck using this solution: How to

UIPageControl doesn't obey it's constraints inside UIScrollView

妖精的绣舞 提交于 2019-12-11 02:56:38
问题 I have a UIScrollView and there are many views inside my scroll view. I am using autolayout and all my views are layed out in the same manner: Left and top spacing to the superview, width and height set. Everything scrolls just fine, however my page control stays whereever it is. It does not scroll with the other elements inside the scroll view. YES, I did check that the page control is inside the scroll view just like the other elements, and yes, I've quadruple-checked the constraints of the

UIWebView not calling UIScrollViewDelegate methods

坚强是说给别人听的谎言 提交于 2019-12-11 02:54:40
问题 In my iphone app i set delegate of my uiwebview to files owner but it is not calling uiscrollviewdelegate methods my code is - (void)webViewDidStartLoad:(UIWebView *)webView{ NSLog(@"webViewDidStartLoad "); } - (void)webViewDidFinishLoad:(UIWebView *)webView{ NSLog(@"webViewDidFinishLoad "); } - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{ NSLog(@"scrollViewDidEndDecelerating "); } - (void)scrollViewDidScroll:(UIScrollView *)scrollView{ NSLog(@"scrollViewDidScroll "); } but

Touch events (touchesMoved) not working on UIViews inside UIScrollView

前提是你 提交于 2019-12-11 02:16:47
问题 I have a UIView inside a UIScrollView , and the UIViewControllers for those views are not receiving the touch events. If I take the views out of the scroll view then it works. UserInteraction is default ON of all views but it's still not working! This must be possible and I'd be really grateful if someone could point me in the right direction! Many Thanks, 回答1: add the following code to implementation file then touches moved @interface UIScrollView(Custom) @end @implementation UIScrollView

UIScrollView inside UIScrollView – ignore scroll view touches when in bounds of text view?

情到浓时终转凉″ 提交于 2019-12-11 02:03:29
问题 I have one UIScrollView inside another UIScrollView , both scrolling vertically. I’m having an issue where when I try to scroll the inner scroll view, the touches are also picked up just afterwards by the outer scroll view. I need touches in the inner scroll view to be exclusively handled by it, and for scrollViewDidScroll to NOT be called on the parent scroll view. I’ve tried all manner of things, subclassing the scroll view and overriding hitTest:withEvent , setting canCancelContentTouches