Making a view scrollable when keyboard active - iphone

I have a view with half a dozen text fields and labels, and a button.
I want it to be that when the keyboard pops up, the view becomes scrollable, so you can scroll the view up and see the bottom half of the fields without having to dismiss the keyboard to get to them.
Just putting it inside a UIScrollView doesn't seem to do it.

You have to set the scroll view's contentSize to enable scrolling.

Related

Smooth Scrolling between Table/Collection View and the Scroll View

I am implementing a scroll view which consists of an image underneath it is a collection view.
What I want to do is a smooth scrolling between the page as if the collection view is just elements in the scroll view.
But what happens is the when I scroll, the collection view needs to be dragged twice to exit it or to enter it.
What I mean is that when the scroll view first appears there is an image and under it is collection view. when I scroll down if I touch the image, the scroll is done correctly, however, if I touch the view the image is still here and a small scroll is done then when I scroll again the scroll is done right and the collection view takes the whole screen
After that when I scroll upwards, the same happens a small scroll happens then I have to touch again to do the scroll right and show the image.
EDIT: This GIF shows would clarify what I mean :
https://im2.ezgif.com/tmp/ezgif-2-75ed33ccd665.gif
Edit: The best solution was to create a TableView/CollectionView header and and my header in it and scroll normally for the table/collection view.
Old solution
The solution as provided in a comment by #MayurKarmur was to disable the scrolling in the collection view and adding height to collection view according to its content.

only scroll half content UIScrollView Swift

in my app, I would apply Scrollview which there are textfields and labels.
but I was very confused, because some textfield can not be shown on the
scroll view and the textfield "country" and further textfield not selectable. scrol bar on scrolview Nor can slide all the way down, only half of the frame content view.
how so I can scroll through the entire content and can use existing textfield?
Image
If you have multiple subviews, you need to update the scroll view content size
I you use autolayout, you can follow this tutorial.

UIScrollView in iOS doesn't response scroll to top

I have two UIScrollViews, one is horizental, the other is like page on the horizontal view. I want to click the status bar and have the vertical scrollView scroll to the top, but it doesn't work.
I searched for some information that said I must set UIScrollView.scrollsToTop=NO, but it doesn't work. Could somebody tell me why?
The scroll view only scrolls to the top if there is a single scroll view present with the scrollsToTop property set to YES.
Make sure it's set to NO on your horizontal scroll view and all the child, vertical scroll views contained within. Then, using the horizontal scroll view's delegate, as one vertical scroll view leaves the visible area, toggle the property to NO and toggle the incoming vertical scroll view's property to YES.

Action sheet in an UIScrollview

I have a full screen UIScrollView to display my image. And the scroll view recognize long press gesture. After long pressing on the scrollview, an action sheet shows up. If i add the action sheet to the window, it will not rotate while I am rotating the screen. If i add it to the scroll view, it rotates but not that good when the scroll view has been zoomed or scrolled. Is it possible to rotate the action sheet well regardless of the scrolling and zooming of the scroll view?
ps. the scroll view is directly add to the window by "self.view = myScrollView;"
Adding the scrollView to the rootviewcontroller or the parent view on which scrollview resides would be better and solve you problem.

How to make modal view scrollable?

I have a modal view with a textview and a button. When the keyboard is displayed it covers up some of my UI elements. I'd like my modal to be scrollable so that it can be viewed while the keyboard is displayed. How can I do this?
I've had the same question, and i've played with it a bit,
setting a UIScrollView is not enough, as in the inspector
you should 1st. increase it Hight, then in the attributes, check the following checkboxes:
Scrolling enabled, Bounce Scroll, always bounce vertically.
Edited: Forgot the most inportant thing:
in the size inspector, set the Buttom field (under content) to the size you wish, (960 is twice the regular size)
Use a UIScrollView instead of an ordinary UIView. You can disable scrolling when you don't want the user to be able to with:
[theView setScrollEnabled:NO];