Как следует из названия, добавить заполнитель к
Код: Выделить всё
UITextViewSimply use
Код: Выделить всё
.textDidChangeNotificationКод: Выделить всё
CATextLayerКод: Выделить всё
UILabelThe problem is:
absolutely, exactly, definitively finding the identical position so that the placeholder is always precisely where the main text is.
(Thus, if your placeholder text is "Add your comment" you should be able to type "Add your comment" and it's absolutely identical.)
Of course, you can trivially set the text font/etc the same, but how to absolutely match the positioning, even as Apple inevitably slightly moves things around inside UITextView, and depending on what it is inside, it's own size etc etc.
How to?
Источник: https://stackoverflow.com/questions/725 ... ith-changi
Мобильная версия