Autolayout form login in Xcode 8 - authentication

I have a problem in managing the autolayout of a form of login with these elements
Form login
The elements are an ImageView on the top, two textFields and two buttons in the middle and another button on the bottom.
Does anyone have any advice?

Connect username field to be centered horizontal in container and vertical space between UIImage and leading ,trailing constraints to the view(left and right ,give value to look similar like in photo if you dont have strict size) after just connect all other fields with username field to be equal width and height ,centered horizontal and vertical space between them.Try to make vertical space like in image ,play litle bit try diferent values that match like in form on photo.
"Continue without registration" set center horizontaly and vertical space to bottom layout (vertical space = 16 ,for example)

Related

UIButtons Alignment

I am trying to implement like word cloud in my app.
The image shown is like word cloud with left alignment.
What I did was, for placing the buttons I am checking whether the width of the text is greater than total width of the screen, if it is greater place the button in next row i.e increment the y position, if it is not just place the buttons. Everything is working fine. But what I want now is , i want to move the buttons alignment, like, I want to start the first button from center of the screen. Please help me to do this...

How to center objects in parent with Dock Fill VB.NET

I'm trying to make a RichTextBox have fixed size and blank space flexible (like Word, WordPad), I made this:
Set Dock to Fill
Set MaximumSize to 600,0 (0 is wildcard for sizes) (Width=600 and Height=0 -wildcard)
I got this: blank spaces are flexible and RichTextBox size is fixed, but RichTextBox is not positioned at center.
I have some options:
Set padding to auto (I suppose that it's not possible)
Set margin to auto (I suppose that it's not possible AND margins not works in winforms)
What do I have to do to position RichTextBox to center?
Use anchor instead of dock.
Dock is designed for Size, Anchor is designed for Location
Your problem is based on location, locate your box to center instead of make Dock margins.

Autolayout on button and textfield in ios

I have made simple login form containing buttons , image and textfields. i am trying to have same layout for all iphone screens . i tried using autolayout to give same space all around the view but its not providing the required results . here is the screen shot of an unwanted result (there should be an equal amount of space on bottom of "Forget password text"):
you should give fixed bottom space to superView(forget password) constraint higher priority then top spacing constraint b/w forget password and sign_in.
EDIT
give a try
1.fixed bottom spacing b/w forget password and superview and fixed top spacing b/w forget password and sign in
2. the spacing between sign in and password textfield must be less than or equal , so that if phone size decrease it will shrink not other constraint.

How to align the bottom of a UIView with the bottom of the screen always

I want a background image to always be aligned with the bottom of the screen regardless of screen size, iOS Version, or Personal Hotspot messages etc. But none of the interface builder alignment options seem to work in every case.
I have 2 different sized images to fit 3.5' and 4' retina which change via code but their alignment is always thrown off by 'Personal Hotspot' and other messages changing the size of the parent view.
My images are the size of the screen and should fill the whole screen always. There is a black area where tab bar and status bar will overlay.
There are buttons aligned with the background and everything gets thrown out by messages that resize the parent view.
I want the bottom of the UIImageView to be aligned with the bottom of the screen always.
have you tried the contentMode property?
theImageView.contentMode = UIViewContentModeBottom;
There is also a menu item for this in interface builder if you prefer to set it there.
then if you are using auto layout, simply add a bottom space constraint from your image view to the bottom layout guide.
If you're not using auto layout, a fixed bottom margin on the autoresizing mask should do the trick.

Positioning UI controls without relying on centers

I'm creating a sample login screen to practice Auto Layout. In portrait mode, it looks like this.
However when I rotate to landspace mode, it looks like this.
Below are the constraints I have set in this layout.
I understand why this is happening. It is because I have a constraint for the User ID UILabel [ Vertical Space(196) ]. How can I position the UIlabel+UITextField set slightly below the horizontal center line of the screen when turned to Landscape?
I assume I can set maybe the middle label to Horizontal Center in Container and then have the other 2 labels positioned relative to that one. But what I'm looking for is a way to position them without the help of center positioning in container. I want them to position slightly below the horizontal center line. How can I do that?
Thank you.
I don't think there's any way to do that in IB, without using the center property -- you could make your views appear below the center by putting another label above User ID, but with no text in it, so it will be invisible. Center that one, and have all the others positioned relative to it.
select all controls and select Top space to superview
Now select only textfields and select Widths Equally
This should work. If not, then let me know i will send you sample code or screens of constraints.