I want to create login and password fields same as in facebook app for iOS. Here is screenshot:
Best way I think you need to create a Custom TableView Cell and Add a textField under it with textField borderStyle being UITextBorderStyleNone
. Also you can give a placeholder string as "Email" and "Password" in respective textFields.
EDIT:
You can have two sections in tableView. Section 0
will contain textFields and Section 1
will have Login Button.
For the Login button, you just need to give the background color to contentView of the cell to make it work as a button. And didSelectRowAtIndexPath:
for Section 1 & Row 0 (ie Login button) will work like button's TouchUp Inside Event.
EDIT-1:
Thanks to @MichaelFrederick suggestion, I got a better solution where in we can create a view with Login button in it and return the view from below method:
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
return yourLoginButtonView;
}
Let me know if you need more help.
Hope this helps
That looks like a customised UITableView
used as a subview. But there are lots of ways of going about this, from using plain old custom UIView
s to having the shape as a background, with text input overlaid on top.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.