On May 20, 2017, at 12:01 , J.E. Schotsman <jesc...@xs4all.nl> wrote:
> 
> I am happy with the result except that I cannot set the placeholder text now.

If the text is not editable, then a text view is a better choice than a text 
field, but it should probably be bordered and maybe have a different background 
color (otherwise how do users know there’s something to scroll?). However, you 
don’t need placeholder text in the sense of text that tells the user what to 
type. Instead, you should probably do what Apple does, e.g. in Xcode when you 
deselect everything in the project navigator on the left, it shows “No 
Selection” in the inspector panel on the right.

To do that, use a second view (a text field, probably) that’s constrained to 
the bounds of the text field’s visible extent. Center the placeholder text 
horizontally and vertically, and use a large font size. Then, when setting text 
into the text view, hide or show exactly one of the two views, as appropriate 
to the text.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to