开发者

Multiple UITextFields grouped together like a UITableView section

I'm looking for a clean way to implement a login screen in my iPhone application. I'd like it to appear as a grouped UITableView section with rounded corners and a separator line below between rows (like e.g. the sections in the Settings app). However, I'd like to give it a slightly smaller cornerRadius than the default setting of a UITableView section.

Another thing I'd like to do in that screen is to add a "register as new user" button which causes the whole screen to slide up, presenting the registration screen. There will be a background image that spans both screens vertically and should slide up with together with the content.

I was first thinking to just make a UITableView, set it to grouped, add two sections (one for login and one for registration), add some space between them and disable manual scrolling on the UITableView. However, I found that putting a background image correctly behind a UITableView and to make that scroll together with its content is a bit tricky..

Perhaps I shouldn't be using a UITableView and just write some code myself that can wrap multiple views (each containing a label and a textfield) togeth开发者_运维问答er into something that appears like a UITableView section? I've been searching around but surprisingly it appears that not too many others are trying to solve this same problem.

Any suggestions would be very welcome!


Sounds like a UITableView is overkill for what you need. I would just create a custom UIViewController and have it handle the layout of all of your subviews as well as any animation you desire.

Just have the parent view take up more space than the device's screen. Then, when you want everything to slide up, animate a change to that view's frame property.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜