3

I want to embed UIScrollViews in my UITableViewCells in order to accomplish the iOS 7 cell sliding paradigm (seen in Mail.app among others).

I normally set up the entirety of my app in Storyboards and use Auto Layout. UIScrollView is unfortunately very annoying to use in conjunction with Auto Layout, so I guess I'm going to have to avoid using it.

What's my best course of action for using UIScrollView with a Storyboard that uses Auto Layout? (I need the scroll view to adapt to a landscape orientation switch, something that would be very easy with Auto Layout.) I still would like to use Storyboards, and need to position the scroll views, but as I can't just switch to strings and struts for one view, and Auto Layout is out, I'm rather stuck.

Should I create its size in portrait, not set any constraints, and then in viewDidLoad set some auto-resizing masks? Or is it only zooming that UIScrollViews and Auto Layout conflict over, and simple panning should be fine?

Community
  • 1
  • 1
Doug Smith
  • 29,668
  • 57
  • 204
  • 388
  • 1
    I don't quite get your question you want to just slide the cell so you can see more options? And you are supporting both orientations? If that's the case I would use UIViewAutoresizingMask UIViewFlexibleWidth | UIViewFlexibleRightMargin You probably might want copy paste your cell code to receive a adequate feedback – artud2000 Mar 28 '14 at 19:30
  • Why don't you use a `UISwipeGestureRecognizer`? – ismailgulek Mar 30 '14 at 21:15

1 Answers1

0

See http://www.teehanlax.com/blog/reproducing-the-ios-7-mail-apps-interface/ and an implementation using autolayout at https://github.com/Jafared/JASwipeCellExperiment.

Courtesy of jafar's comment on Swipe to Delete and the "More" button (like in Mail app on iOS 7).

Community
  • 1
  • 1
vlad_x2
  • 3
  • 2