Monday, July 27, 2015

Removing text field border after applying it

I encountered this problem today

I wanted to show to the user that a particular text field could be edited. Hence, I added a borderStyle with


self.phoneCodeTextField.borderStyle = .Line

But the problem is, I cannot remove the borderStyle with 

self.phoneCodeTextField.borderStyle = .None

Solution:

Make the textfield border rounded rect first before removing the border
self.phoneCodeTextField.borderStyle = .RoundedRect
self.phoneCodeTextField.borderStyle = .None

No comments:

Post a Comment