Welcome, Guest
Username Password: Remember me
  • Page:
  • 1

TOPIC: Text Field Frame

Text Field Frame 1 year, 2 months ago #1

Tarek, is it possible to put the text field in a "frame" or box.. As it is, the user does not know where to tap..

Could you explain how...

Many thanks.

Re: Text Field Frame 1 year, 2 months ago #2

daviddelmonte wrote:
Tarek, is it possible to put the text field in a "frame" or box.. As it is, the user does not know where to tap..

Could you explain how...

Many thanks.


Ways that come to mind right away depend on how the cell is generated but one way is:

 
 
...
SCTextFieldCell *tfc = [SCTextFieldCell cellWithText:...];
tfc.borderStyle = UITextBorderStyleLine;
...
 
 


or use the delegate method

 
 
- (void)tableViewModel:(SCTableViewModel *)tableViewModel willConfigureCell:(SCTableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
 
if ([cell isKindOfClass:[SCTextFieldCell class]]) {
((SCTextFieldCell*)cell).textField.borderStyle = UITextBorderStyleLine;
}
}
 
 
  • panamind
  • OFFLINE
  • Senior Boarder
  • Posts: 77
  • Karma: 4

Re: Text Field Frame 1 year, 2 months ago #3

Thanks! They work.. They are ugly*, but they work..

* the textfield width varies depending on the label.
Last Edit: 1 year, 2 months ago by daviddelmonte.

Re: Text Field Frame 1 year, 2 months ago #4

Thanks Gary!

David: To unify the margin of the text fields, please check out the SCTextFieldCell properties called "maxTextLabelWidth" and "controlIndentation" (inherited via the SCControlCell superclass)
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: Text Field Frame 1 year, 2 months ago #5

Perfect, Thanks Tarek. Thanks Gary.

FYI- It looks even better with UITextBorderStyleRoundedRect.
  • Page:
  • 1
Time to create page: 1.56 seconds