ios - QuartzCore method of styling UITextField border not working -


i cannot life of me work out why code isn't working:

@username_textfield = uitextfield.alloc.initwithframe([[50,50],[50,50]])  @username_textfield.layer.cornerradius=1 @username_textfield.layer.maskstobounds=true @username_textfield.layer.bordercolor= uicolor.redcolor @username_textfield.layer.borderwidth= 1 self.view.addsubview(@username_textfield) 

ok after head-wall-interaction, realised i'd diverged examples on so: providing uicolor rather cgcolor, , silently failing. annoying.

so, solution add .cgcolor:

@username_textfield.layer.bordercolor= uicolor.redcolor.cgcolor 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -