How to make UITextView look like Facebook login? - iphone

How can I make my textfields look like the Facebook login screen?
alt text http://img688.imageshack.us/img688/4162/photocr.jpg

That's really a UITableView. You can put some UITextFields without a border inside a couple of UITableViewCells.

I'm extremely late to the party - but this library makes this sort of UI much easier: https://github.com/escoz/QuickDialog

Use a grouped table for your UITableView (i.e., UITableViewStyleGrouped) with one section and two rows. Then put UITextFields in the table cells (you may have to make custom table cells) and set the placeholder property to whatever text you want to display before the user types somethings.

It might be a UITableView, but then again it could be just a UIView with rounded corners and two UITextFields and a separator line.

I believe you're asking how to style UITextView, not how to setup a UITableView, so what I would do is create a .PNG image that's mostly white with two little rounded corners up top. Flip the image vertically and you have the one for the bottom. Drag both to your resources folder in XCode, then open up Interface Builder with the .xib. Set the background color to your blue. Click on the text field, go to Inspector and select the image you just created in the Background field. Do it again for the other field. You can use the Placeholder field to create the gray "Email" and "Password" placeholder text.

Related

how to create a sectioned TableView for profile in iPhone

I saw this picture on Internet:
the section with the add Photo Frame and two rows (First, Last)...
How do you achieve a design like that!!!
I only know how to make rows (static and dynamic) in xCode using the full width of the screen but not in a single section but not making such a divisiĆ³n and adding a frame out of the other two rows
my designs are like this
Any help I'll appreciate
thanks in advance
It's not really clear that the example you've given is actually embedding the first, last part into a table view. It could just as easily be a single cell that has embedded views with borders to look like rows. Here are a few ways I see to accomplish the view you've given.
Have them be actual rows - but use a custom cell layout that offsets the 'First' and 'Last' labels to be further to the right. Then create a UIImageView for the profile that sits on top of the UITableView cells, but inside of it. Basically insert it as the first subview of the UITableView. It should cover the top left of those top two cells. You can do this since those cells have a static known hight and you've set the left offset. Another option would be just inserting it into your top cell, but having it overflow the bounds and setting clipsToBounds = NO.
Make the entire top view a custom UIView that uses CALayers or CoreGraphics to manually draw the lines and layout such that it looks like part of the table view. Set that as the TableView header, or the first section Header.
There are a lot more things you can do like changing frame layout as well.
you can achieve this with the use of xib read carefully and if you don't understand anything you can ask me again it's bit tricky
in you xib create a UIView and design for your photo and firstname, lastname cells with the use of textfields image views and all and then take a UITableView.
now drag your UIView and drop it on your UITableView so that it will be considered as your table header and your first section now will be as you designed like photo with firstname and lastname fields.
i've done this in manier projects of mine so hope this way you can also do this thing and ask me if you need any help.

How to set different width of elements [iPhone-dev]

Look this pic:
The usernames are UIButton. How can I put a UILabel (with the comment text) just after the UIButton (with the username) ?
The UIButton username's is dynamic. How can I do this?
That looks like a UITableView, if that's the case you should subclass UITableViewCell. If it isn't, I would
consider making it one
build a container class that (or make your subclassed UITableViewCell such that it) contains both a UIButton and a UILabel and dynamically position the text inside the label according to the size of the button (for instance, adding the right number of spaces to the beginning of the text).
You're going to have to use Core Text or web views to achieve this. There's really not a super easy way to do this. It's simple enough to place view next to each other based on their calculated sizes, but to have text wrap to multiple lines with embedded font style variations and attachments (i.e., images), you're going to have to read up on Core Text or use XHTML in web views.

How can I have UITableViewCells with rounded corners?

My app has a ManagedObject that has different types of fields
So, I want it for the user to edit each one and also have it display different info for each.
If you look at the Calendar app, when you Add an Event, you'll notice Title/Location in one cell, Starts/Ends in another, Repeat... so on.
So... in Interface Builder I have all my UITableViewCells but they are all squared. Not with neatly rounded corners.
Is this done with IB and I'm missing a setting? Are they all different views amassed in one place?
I know I will have to custom code each one. I just want the rounded corners first.
To get rounded UITableViewCells, change the style of your UITableView from "Plain" to "Grouped". This can be done in Interface Builder. Then, since it's actually the edges of each section that get rounded, put each cell in its own section.
For me the problem was that I made a subview of UITableViewCell and put all my controls in there. If you do that, then you'll see the corners cut. After dragging everything on the content view, the problem was solved.

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) together 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.

UITableView like Contact App

I try to create an UITableView similar to the Standard Contact App, when selecting a contact (i.e. grouped style). But how do I get some controls at the top or at the bottom of the cells, which scroll with the rest? In the Contact App you have at the top the picture together with the name and at the bottom three buttons. Are these just special customized Cells? Or can you have controls directly there?
Thanks for your help!
Regards
Matthias
I played with table header/footer views. You can create them in IB and assign them to
self.table.tableHeaderView = yourHeaderView;
self.table.tableFooterView = yourFooterView;
Needless to say, that you customize them as your wish.
Another option is to customize a table cell view for the section 0 if you have a grouped style table. You can add there a picture and a button, whatever you want.
In both cases all your elements will scroll with the table view.
Is that what you asked for?
When I did this functionality, I used a combination of UIViews and UITableViewCell.
As a header I inserted UIView, and it placed the UIButton (with picture) and UITableViewCell. After laying a transparent UIView and subscribe to UIControlEventTouchUpInside, which highlight the cell ([self.tableHeaderCell setHighlighted:YES];)