Frage

I have a UITextField which I created programmatically. This text field is used to input a time. The placeholder text is "00:00:00.000". When the text field is tapped, a number pad will appear. Ideally, I want the gray place holder text to remain as the user types. As they enter a number, it replaces the gray zeros in the place holder text and skips over the colons and period (leaving the format intact without the user entering any punctuation). If it is not possible to keep the place holder text and replace it as the user types, I would like the punctuation to automatically be entered.

Thanks in advance!

War es hilfreich?

Lösung

iOS has a UIDatePicker control for this, if you want to go the way you are going then you will have handle all the user input your self.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top