views:

412

answers:

2

How do I put readonly text inside a UITextField. For example, the "Name" and "Security" fields in the iPod touch "Other networks" settings contain, respectively, the words "Name" and "Security", with an editable area to the right. UITextField has a "placeholder" property but that disappears as soon as I type.

A: 

What you're seeing in those fields is not that the UITextField has a label but that the UITableViewCell has two controls on it - a label and a textfield without a border.

rein
I only need to have two textfields so I was hoping to avoid having to implement a UITableView.
twelshesgi
It's not really wrong or hard to implement a UITableView to host two text fields - and having control over the UITableViewCell for labels is a bonus.
rein
A: 

simply put this line where txtname is object of UITextField txtName.userInteractionEnabled = NO;

suchita