Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack layout #27

Closed
mergesort opened this issue Feb 23, 2015 · 5 comments
Closed

Stack layout #27

mergesort opened this issue Feb 23, 2015 · 5 comments

Comments

@mergesort
Copy link

Hi there, been using the library for a bit and really liking it.

I was wondering how the layout the views that are behind the top are determined? In this stack, sometimes they're all from the left, sometimes they're peeking in from the right. What I'd really like to mimic is the way it was in the demo, where sometimes they're peeking from the left, sometimes from the right, in an almost concentric fashion.
layout

Thanks so much for library!

@zhxnlai
Copy link
Owner

zhxnlai commented Feb 24, 2015

Thanks for reporting this!

That is weird. I have never had this problem before. The subviews are default to be centered at its parent view (the ZLSwipeableView instance). What is the frame of the ZLSwipeableView? I think it might be causing the problem.

@mergesort
Copy link
Author

@zhxnlai The ZLSwipeableView's frame is (20 10; 280 280) instance is inside a UITableView headerView which has a frame of (0 0; 320 300). I've tried it with both auto layout, and frame based layout, but end up with that issue.

@mergesort
Copy link
Author

@zhxnlai I followed the example more closely and got it to work. I think the behavior is a bit strange.
Before in nextViewForSwipeableView: I was creating a square view, and returning it. I added a container view, and then added my square view to the container view, and returned the container view in nextViewForSwipeableView:, and the layout worked. I'm not sure if it makes sense to require this container view for a proper layout, or that is a bug. Let me know if there's anything more I can do to help?

@zhxnlai
Copy link
Owner

zhxnlai commented Feb 27, 2015

What you described is a way to work around the issue with using autolayout in subviews. Did you use autolayout in the subviews?

@mergesort
Copy link
Author

Yep, auto layout. This fixed it, thanks! I'll close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants