rohinb rohinb - 1 year ago 179
iOS Question

iOS - Getting desired shadow above UITabBar

I am trying to get my tab bar shadow to look like the one seen in this image:



What is the best way of doing this? I am using objective-c

Thanks

Answer Source

You can give shadow by using following code to any UI object

tabControl.layer.shadowOffset = CGSizeMake(0, 0);
tabControl.layer.shadowRadius = 2;
tabControl.layer.shadowColor = [UIColor blackColor].CGColor;
tabControl.layer.shadowOpacity = 0.3;

Here i gave example for your tabControl object.