logo
Tags down

shadow

How do I scroll a set of UIScrollViews together?


By : Elżbieta Surówka
Date : October 18 2020, 11:12 AM
help you fix your problem Ok, got it working. for the tips Ricki!
2 things to add to Ricki's solution, if you want to avoid an infinite loop, you have to check to see whether the scrollView's tracking or dragged properties are set. This will insure that only the ScrollView that is actually being dragged is calling the delegate.
code :


Share : facebook icon twitter icon

How to sync scroll with multiple UIScrollViews?


By : Youssef Dinamo Dakhn
Date : March 29 2020, 07:55 AM

UIScrollViews all scroll in the same time


By : Hoop Jumper
Date : March 29 2020, 07:55 AM
should help you out Keep an array of all of your UIScrollView objects. Make sure all of their delegates point to the same object (or if that's not possible, there is some sort of handler that gets called on scrollViewDidScroll). Then use setContentOffset to adjust the offsets. You had the right idea, but you just want to make sure all scroll views except the current view (which is determined by the delegate method argument) is scrolling.
code :
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
  for (UIScrollView *view in self.scrollViews) {
    if (scrollView != view) {
      [view setContentOffset:scrollView.contentOffset];
    }
  }
}

Make 2 UIScrollViews zoom and scroll identically


By : zokratez
Date : March 29 2020, 07:55 AM
Hope this helps I have a screen which has two UIScrollViews. Inside the scrollview is a zoomable UIImageView. , I solved it guys! Props to me.
code :
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {

    if (scrollView == self.scrollViewLeft) {
        [self.scrollViewRight setZoomScale:[scrollView zoomScale]];
        [self.scrollViewRight setContentOffset:[scrollView contentOffset]];
    } else {
        [self.scrollViewLeft setZoomScale:[scrollView zoomScale]];
        [self.scrollViewLeft setContentOffset:[scrollView contentOffset]];
    }
}

scroll and pinch in multiple UiScrollViews at the same time


By : Aj Roy
Date : March 29 2020, 07:55 AM
it should still fix some issue Found a solution to my own question. This solution does not call scrollViewDidScroll() in the others cells, which is exactly what I wanted.
Here is the trick :
code :
// pinch-pan detection :
func scrollViewDidScroll(_ scrollView: UIScrollView) {
    let newOrigin = scrollView.bounds.origin
    let dx = newOrigin.x - currentScrollViewOrigin.x
    let dy = newOrigin.y - currentScrollViewOrigin.y

    let newScale = scrollView.zoomScale
    let ds = newScale - currentZoomScale

    if let d = delegate{
        d.notifyMouvementInCell(self, dx: dx, dy: dy, ds: ds)
    }

    currentScrollViewOrigin = scrollView.bounds.origin
    currentZoomScale = scrollView.zoomScale
}
func notifyMouvementInCell(_ cell: customCell, dx: CGFloat, dy: CGFloat, ds: CGFloat){
    if areViewsLocked{
        for visibleCell in collectionView.visibleCells as! [IMECasesMultiDisplayCollectionViewCell]{
            if visibleCell == cell { continue }
            visibleCell.copyMouvementInForeignCell(horOffset: dx, vertOffset: dy, scaleOffset: ds)
        }
    }
}
func copyMouvementInForeignCell(horOffset dx: CGFloat, vertOffset dy: CGFloat, scaleOffset ds: CGFloat){
    var newOrigin = scrollView.bounds.origin
    newOrigin.x += dx
    newOrigin.y += dy
    scrollView.bounds.origin = newOrigin

    var newScale = scrollView.zoomScale
    newScale += ds
    let affineTrans = CGAffineTransform(a: newScale, b: 0, c: 0, d: newScale, tx: 0, ty: 0)
    // imageView is the view contained in each of my cell's scrollViews
    imageView.layer.setAffineTransform(affineTrans)

    currentZoomScale = scrollView.zoomScale
    currentScrollViewOrigin = scrollView.bounds.origin
}

Horizontal UIScrollView having vertical UIScrollViews inside - how to prevent scrolling of inner scroll views when scrol


By : Dalo Chink
Date : March 29 2020, 07:55 AM
this will help @stanislaw, I've just tried the solution you suggest on an iPhone device.
I see your problem.
Related Posts Related Posts :
  • calling selector with two arguments on NSThread issue
  • Objective-C: Instance Method is Never Called
  • iPhone: How to Get Basic Authentication to HTTPS Web Service Using NSURLCredential
  • How to set the Tab bar item 1 to be selected by default in iphone?
  • Is it possible to insert an animation into an UITabBarController thats shown when switching Views?
  • CAScrollLayer doesn't scroll!
  • sizeWithFont doesn't give correct height for UITextView if there is a long string in the text being wrapped
  • iPhone ABPeoplePickerNavigationController - How to select two single entries of two different multivalue properties of a
  • iphone sdk: application icon not displaying in simulator
  • Which method should use to release an object?
  • UILabel and superscript
  • UIFont crash problem
  • Is there any way to prevent the user from deleting the installed application?
  • How do I import a CSV file into my iPhone application?
  • How to Post attachments to twitter using twitter API
  • CALayer and obtaining currentcontext of its UIView
  • Scrolling don't work in UITextView included in UIImageView
  • Deleting photos from Resource Path
  • Objective-C copy an NSArray properly?
  • Is the APN Device Token unique to each individual app?
  • NSURLCache Problem with cache response
  • iPad viewWillAppear and presentModalViewController problems
  • How to set the position of a sprite within a box2d body?
  • Localization of strings in static lib
  • How to download text file from web on iPhone?
  • Tesseract Example for Iphone
  • How to record speech in iphone?
  • strange multiple files download - NSURLConnection
  • Is there anyway to get javascript error on android or iphone mobile webkit browser?
  • Keeping UINavigationController's navigationBar hidden after UISearchDisplayController selection
  • Hiding a UINavigationController's UIToolbar during viewWillDisappear:
  • how to run application in background in iphone?
  • Some stress tests on my Iphone app
  • I want to know how to sort the dates in objective c?
  • how to hide URL bar in ipod touch
  • ABRecordRef vCard
  • OBJ-C: Getting the minimum/maximum value in a NSMutableArray
  • iPhone NSMutableArray Memory Leak
  • iPhone UIBarButtonItem setCustomView: method?
  • Can't update text in UILabel
  • uiwebview session problem
  • Rich Text Format RTF codec for iPhone
  • iPhone: How I can Access Data in a View Controller Class from Another Controller Class?
  • Trying to add mini UIToolbar under UINavigation bar in a Tabbar application
  • iPhone: Application Install Fails With "Invalid Signer" Error
  • EXC_BAD_ACCESS on ReloadData
  • iPhone: Trouble reading badge value from uitabbaritem
  • my first iPhone app and i'm stuck
  • AVAudioPlayer: How to Change the Playback Speed of Audio?
  • How do I make my own recordedPath in GLPaint Sample Code
  • How do I get Attributes from Core Data into an Array for - iPhone SDK
  • How do I set an array with another Array?
  • Finding iPhone Application Identifier Prefix programmatically
  • iPhone cellForRowAtIndexPath returns cached cell
  • Rotating only the MapView's content
  • Synchronizing Core Data data with External Database
  • EXC_BAD_ACCESS when calling pushViewController
  • Is there a way that I can make a program like GLPaint using CGContext?
  • iPhone SDK - How to scroll a UITableView programmatically with animation?
  • Can the iPhone render vector graphics files directly? What formats are supported?
  • shadow
    Privacy Policy - Terms - Contact Us © bighow.org