I have a found the solution of my own. i have a created one method - (void) viewWithEffects: (UIView*) myView {// copy the shadow code from the question}
. Now i called this method to - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{}
.
So when orientation change didRotateFromInterfaceOrientation
call and it will give the Corner with Shadow effects.
Shadow will set to your view according to Autoresize
your view. if your app not supported for both orientation than dont need to do this. Just call one on viewdidload or viewwillAppear
. i hope it will help .