ios - set the padding of a text field using swift in xcode -
how create space @ beginning of text field using swift? looked @ post
i don't understand subclass doing , how use class padding.
thank much
https://stackoverflow.com/a/27066764/846780
this answer clear,
if subclass
uitextfieldcan overridetextrectforbounds,editingrectforbounds,placeholderrectforbounds. these methods allow add rect (frame) textfield's label.newboundsmethod create rect (frame) added textfield's label.finally padding is:
let padding = uiedgeinsets(top: 0, left: 5, bottom: 0, right: 5);now have custom uitextfield has custom padding.
if create new subclass
class mytextfield: uitextfieldexample, need change class of uitextfield you've added ib file.

Comments
Post a Comment