简体   繁体   中英

how to customize uitextfield appearance

I want to customize the UItextbox

I want to get rid of the rounded corners and just keep a bottom line.

If I could have a my own color for the bottom line then it'd be good 在此处输入图片说明

But I am unable to find a way to do this

Answering your question objectively, you need to create a new class extending UITextField, in this way you will define the behaviour what you want. If you do not know how to start I suggest you get some custom UITextField as an example from GITHUB, there are so many there. Observe how to custom and draw things inside the control. When you have an extended UITextFiled class, select the control on your XIB or storyboard and you need just set the base class of control in XCODE as shown in the picture below. I hope it helps you.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM