How to make a login screen like Facebook app?

2020-06-23 06:28发布

问题:

How can I make a login screen like the Facebook app with "Email" and "Password" textfields?

Facebook Login

I'm really new to iOS programming, sorry if this is an easy question.

回答1:

First of all you have to understand UIViews and UIViewControllers creation and management.

Then, you could ask your self if you want to create the interface through xib files or programatically. The first way is quite simple. By means of drag and drop operations you could create a user interface in a short time. The second, instead, is more complex for a newbie but I think it could be a valid solution to understand stuffs.

Note that each operation that you do in xib files can be done programatically.

Now, I'll try to explain what elements you need to create that interface.

To create the interface like the following you could create a xib view interface. The view for this interface is the container for your elements. To the container view you could add a UITableView with a grouped style. This UITableView has 2 rows and each row allows to enter text by means of UITextField. To do this, you have to create it programatically. No chance to do it with xib.

Login and signup can be created with two UIButtons. To those buttons you need to attach some actions.

Finally the background image could be set programatically as a background image for your container.

This is a simple description on how to create such an interface. Before starting, I suggest you to read some tutorial on how to:

  1. Use UIView and UIViewController
  2. Create interface trough xib
  3. Interact with interface xib through outlet and actions
  4. Use UITableView and understand its management
  5. Customize or editing UItableViewCell
  6. Use UIImageView and/or UIImage

A good starting point for iOS application development could be www.raywenderlich.com/tutorials.

Hope it helps.



回答2:

1)In your Xib file..add an image view..set it to the image you want..that will be background like in the Facebook pic.(blue) and that image should include middle (email and password background) part as well.

2) Drag and drop UITextField on it. Make the background custom.



回答3:

Since you are new..I will point out the details..and then you search on them that way you will understand better :

Search on each of these things on google..cant give info for each.

1)In your Xib file..add an image view..set it to the image you want..that will be background like in the Facebook pic.(blue)

2)The middle part is a UITableViewCell with one section and 2 rows..search on it..

3) And the Log in and sign up are UIButtons..add them in xib and make them IBOutlets..again search on it