Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
textField に変数プレースホルダーを追加したいのですが、textField に何かが書き込まれている場合、プレースホルダーを変更せずにそのテキストをプレースホルダーに追加する必要があります。どうすればいいですか?
これは、clearsOnBeginEditing プロパティを使用して FALSE に設定することで実行できます。
textField.clearsOnBeginEditing = NO;
Interface Builder でテキストフィールドを作成している場合は、Interface Builder のインスペクターに移動し (コマンド 1 を押す)、最後に [編集開始時にクリア] オプションのチェックを外す必要があります。