ios - Adding a border and shadow to a nib initiated view -


i making subclass of uiviewcontroller which, when user pressed button, initiate , add view uiviewcontroller subclass.

inside added view have instance of uiwebview , uibutton (for closing popup).

since intended pop up, want add border , shadow uiwebview, since nib initiated, don't know how can modify drawing code.

any help? :)

take @ using view's calayer.

to add border:

myview.layer.borderwidth = 1.f; myview.layer.bordercolor = [uicolor blackcolor].cgcolor; 

there similar methods adding shadow:

myview.layer.shadowcolor = [uicolor blackcolor].cgcolor; myview.layer.shadowoffset = cgsizemake(4.f, 4.f); myview.layer.shadowradius = 4.f; myview.layer.shadowopacity = 0.5f; myview.layer.shouldrasterize = yes; 

you need add quartz framework target, , import header in controller's .m file:

#import <quartzcore/quartzcore.h> 

Comments