I am trying to create an inner shadow to create a sense of depth for my UIButton.
I tried the following code, but it doesnt create a shadow if i set a background color. If I set the background color to clear color then it displays a sort of shadow. but i cant control the strenght more than upping the shadoOpacity to 1.
_selectRoutineBtn.layer.masksToBounds = YES;
_selectRoutineBtn.layer.cornerRadius = 8; // if you like rounded corners
_selectRoutineBtn.layer.shadowOffset = CGSizeMake(11, 11);
_selectRoutineBtn.layer.shadowRadius = 2;
_selectRoutineBtn.layer.shadowOpacity = 0.5;
[_selectRoutineBtn.layer setBorderWidth: 1.0f ];
I attempted to use this which was used in another post but I dont know how to implement that.
Could anyone tell me how could i implement that file into my UIButton (I tried putting it in the IB as the class but doesnt do anything) to create the inner shadow or any other solution that i could use to create inner shadow?