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.
誰かがObjectiveCのUITextFieldにクリアオプション(「X」記号)を表示する方法を教えてもらえますか?閲覧用の画像を添付しました。画像に表示されている「x」記号でテキストをクリアしたい。
myUITextField.clearButtonMode = UITextFieldViewModeWhileEditing;
Interface Builderを使用している場合、テキストフィールドを選択すると、atturbutesインスペクター(右側)に。のオプションが表示されClear Buttonます。オプションの1つは、「編集中に表示される」とその他のいくつかです。
Clear Button
コードでは、@Shashankによる回答を参照してください。