UA-17470720-3

Jump to content


Photo
- - - - -

Placeholder text instead of label


  • Please log in to reply
4 replies to this topic

#1 Karl

Karl

    Jr. Member

  • STV 2.0
  • PipPip
  • 13 posts
Reputation: 0
Neutral

Posted 22 September 2010 - 06:54 PM

Hello again,
I would like to request an option that would set the placeholder property of a text field instead of the cell label and make the text field the full width of the cell.

Thank you!

#2 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 23 September 2010 - 03:09 AM

Hi Karl,

If you don't set a label for an SCTextField cell, Sensible TableView will automatically have the text field take the whole cell width. Is that what you need?

#3 Karl

Karl

    Jr. Member

  • STV 2.0
  • PipPip
  • 13 posts
Reputation: 0
Neutral

Posted 23 September 2010 - 05:03 AM

Okay I see how to do it now:
[myclassdef propertyDefinitionWithName:@"firstName"].attributes = 
[SCTextFieldAttributes attributesWithPlaceholder:@"enter your first name"];

If that wasn't possible I was hoping for something like this: ;)

SCClassDefinition *myclassdef = 
[[SCClassDefinition alloc] initWithClass:[myclass class]
withPropertyNames:[NSArray arrayWithObjects:@"firstName", /*etc.,*/ nil]
withPropertyTitles:[NSArray arrayWithObjects:@"enter your first name", /*...,*/ nil]
usePropertyTitleForPlaceholderTextInsteadOfLabel:YES];


Thanks!!

#4 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 23 September 2010 - 06:02 AM

Oh I get what you mean, and I think it's a really nice idea! :)

We should probably implement this as a BOOL property of SCTextFieldAttributes and call it "displayTitleAsPlaceholder". What do you think?

#5 Karl

Karl

    Jr. Member

  • STV 2.0
  • PipPip
  • 13 posts
Reputation: 0
Neutral

Posted 23 September 2010 - 07:35 AM

If anyone else would find that a useful feature, then sure!
However, I'm okay with using attributes.

Thanks again!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users