Making a Title scroll in a UIScrollView with the text below - iphone

I have a storyboard with a UIScrollView taking up the entire iPhone screen. I have a label at the top for the title, and then a textview below that which has text loaded into it from a .txt file. However when I scroll, it scrolls through the large body of text with the title staying put at the top of the view, even though the label is based in the scrollview rather than outside of it. Any ideas how I can fix this?
Thanks!

textView has its own scrolling method built in, so your textView will scroll independently of your scrollView. Create the title within the textView or set text view not to scroll in Interface builder and use your scrollView

Related

How can I make ScrollView full screen? I placed the necessary constraints, but it doesn't work

I'm trying to make a ScrollView so that its size adjusts to the size of the text. I placed all the necessary constraints
, but when the application is displayed on the simulator, the content view starts from the safe area and also ends up to the safe area. Although I have pinned scroll view to superview and content view to scroll view.
I want the content to start not from the safe area like here ,
but from the start of the screen like here
in other words, I want to remove the blue bar from the top and bottom
Do you have any ideas how to do it?
Sometimes UITableView & UIScrollView can still show safe area even though you attach your View to top of Super View. You just need to add one line to solve this issue but make sure your ScrollView is connected to superView not safe area at the top.
Add scrollView to your ViewController and in viewDidLoad() just write:
scrollView.ContentInsetAdjustmentBehavior = .never
Check this answer for further details: Make UITableView ignore Safe Area

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.

iPhone - scrollview with a textview and tableview inside

I have an interface which will have a text view and a table view below it. My current view looks like this
UIScrollView
UITextView
UITableView
Currently the TextView and TableView can scroll vertically..but what i want is the whole screen to scroll up/down. Why doesn't this work properly?
You can put a TableView inside a ScrollView, but you must resolve conflicts between touches, scrolling, and bouncing in IB or with code, and you must set the ScrollView's contentSize with code, not in IB.
If the TextView really "belongs" to the table, consider putting it in a table cell, or better, as a header, that's what they're for.

View elements resize problem

I have a UiView which contains a UiWebview, UIButton and a UITextView as its elements.
I add this UiView to a UIScrollView and resize the frame so that the text view is not visible. When i click the button i resize the view to display the entire UIView including the UItextview.
The problem is , the text view appears below the view when i resize the frame. When i click expand it covers the text view too.
When view is first added i want the view to display just the webview and the button and when button is pressed it should display the text view.
How do i achieve it? Has it got to do with view hierachy?
you should enable clipping on the UIView .
edit:
I wouldn't resize the view. Instead I would just change the hidden-property on the textview. If you want to add some animations later then you can modify the alpha-property as well.

Making a view scrollable when keyboard active

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.