Auto-Layout UIScrollView and an animated UIView - ios

Currently having an issue with using auto-layout and UIScrollView. The issue is when I scroll down on the scroll view, a previous UIView (that should be free roaming, and is animated to various positions) gets set back to its initial location where it is located in Storyboard.
What's the best way to make my single UIView not follow the behavior of auto-layout and let it do whatever it wants to do?

Related

How to handle an UIScrollView in an UIScrollView

I want to use an UIScrollView in an UIScrollView. I think it would be clearer with a
picture
The black border is the border of the screen, the purple is the first UIScrollView and the blue is the second UIScrollView. The arrows show the direction of the scroll.
When I try to put the second UIScrollView in the first with a different scrolling direction, the second show the content twice... I made a video
I have created design for you to explain how to add scroll view inside scroll view.
Here see the following image with constraints.
Note: This is static view not dynamic, This is create to clear concept of ScrollView inside ScrollView. If you are planning to make ScrollView with design then you need to do some more study on AutoLayout with ScrollView.

scrollview within a containerview in storyboard not scrolling

I have a viewcontroller with one UIView on the top and a containerview placed right beneath it. Like,
I'd connected everything with Autolayout.
Now, I want to load 4 different containerviews in that bottom space(one over the another, since at a time I'll show one containerview only and will hide the rest using alpha property of a UIView), of which one of the containerview has so many subcomponents(registration page comps), for which I used a UIScrollview. The scrollview is not working in this scenario, my question is,
Can I use a scrollview within a containerview?
My scrollview has a UIView in it, which inturn holds the individual components, is that the reason why my scrollview is not working?

Animating UIView with auto layout when the view is just created and about to appear

I have a UIView that contains subviews that contains subviews...(Hierarchy of UIViews).
Every UIView is set with auto layout. When I press a button, this UIView is created and then I would like it to drop from the top of the screen.
The problem when I use layoutIfNeeded in an animation is that if will animate everything at the same time as it is a newly created UIView (not yet display).
My question is, is there a way to do the animation of only the UIView dropping with all the subviews already laid out in it?
I guess you can do it by creating the UIView when UIViewController displays and then hide it but I was wondering it there was another way.
Cheers
If you call layoutIfNeeded right after you add it to a view, while still outside the view, it should lay out it's views correctly. And then in the animation you call it again so the view animate to the final position.

UIView at bottom UIScrollView does not appear

I'm trying to get an UIScrollView working with my Storyboard. It works but the UIView at the bottom that I use with a gesture tap for getting back is not showing. How can this be?
So everything works expect that. This are the things that I did:
Set freeform in Storyboard
Disable auto layout for the Storyboard nib
Changed the freeform dimensions to X:320 Y:800
Dragged some labels and stuff in the Scrollview
Created an outlet for the ScrollView
Enabled scroll programmatically
Enabled Contentsize CGMakeSize() programmatically;
So I normally did everything, why isn't my UIView showing up at Y:750. The only thing I do with the UIView is setting the Background/CornerRadius.
It would be if your UIView is no included in the calculation for the content size. Other than that I cannot see anything obvious.

Rearrange UIView Subviews if a Subview is removed in Auto Layout

I am in a need of implementing a drag and drop controller in Full-Auto Layout environment.
I have achieved the dragging and dropping successfully, but the issue is if I drag a subview from another view the other related subviews behave weirdly,
as an example the subviews are laid out horizontally in scrollview are related to each other, so if I remove a subview the other views should rearrange them self automatically.
Regards,
Dhanesh.
when you doing the design part of xib uncheck the autolayout.
After completing the designing then go towards to autolayout and arrange the view using constraint adding.

Resources