How can I place two views on the same screen using autodetect constraints

I would like to create applications that have 2 views (top and bottom).

The top view is scrolling and contains several text boxes and labels.

The bottom view is not scrolling, but it needs to be adjusted automatically so that it fits into the bottom screen like a keyboard when the screen is resized (I want it to be usable from iPhone 4 to 6 Plus). The bottom view will display a custom function button to trigger actions and updates in the top view.

It works for me on Android with LinearLayout, but I'm stuck on iOS.

Screenshot

+3


source to share


2 answers


Try placing your table or scroll view at the top to scroll and the UIView at the bottom. make the height constant UIView, and the table or scroll view you will be using at the top will resize to fit the screen. If you are confused, please post a comment.

For table view see this iOS tutorial - Custom table cell not full width UITableView

Step1: Place the table view and view as shown below. upper part - table view and below - view

enter image description here

Step 2. Place the view constraints as shown below.

AT first

enter image description here



In the second

enter image description here

Step 3: Place constraints to view tables below

enter image description here

Try and let me know what you have

+1


source


In your case, I suggest dragging all these buttons into UIView

. Then place the buttons at the desired spacing. Select all buttons and set equal width and height constraint. And then set limits on the distance between adjacent buttons or views. And then give constraint for UIview toUIViewcontroller



+1


source







All Articles