I have increased the tab bar height by using CGRectMake, and my questions is: can I increase the shadow (that appears over the tab bar item when is selected) height ? and how ?
Asked
Active
Viewed 1,781 times
2 Answers
1
For your question even I didn't try it before, but I think it's possible, from this reference link http://developer.apple.com/library/ios/documentation/UIKit/Reference/UITabBar_Class/UITabBar_Class.pdf, please look at shadowImage Discussion
Discussion
The default value is nil, which corresponds to the default shadow image. When non-nil, this property
represents a custom shadow image to show instead of the default. For a custom shadow image to be shown,
a custom background image must also be set using the backgroundImage (page 5) property. If the default
background image is used, then the defaultshadow image will be used regardless of the value of this property
UPDATE: Thank you for Muhannad Dasoqie
, to discover this by himself :)
[self.tabbarController.tabBar setSelectionIndicatorImage:[UIImage imageNamed:@"Selected_Tab_Shadow.png"]];

piam
- 653
- 6
- 13
-
How I can use the provided code ? self,tabbarcontroller.tabbar = [[UITabBar appearance] setShadowImage:[UIImage imageNamed:@"yourShadowImgWithHeightThatYouWant.png"]]; ?? – Muhannad Dasoqie Nov 12 '12 at 10:04
-
could you please try this [self.tabBarController.tabBar setShadowImage:[UIImage imageNamed:@"yourShadowImgWithHeightThatYouWant.png"]]; – piam Nov 12 '12 at 10:22
-
do you set backgroundImage too? – piam Nov 12 '12 at 11:37
-
no, it's already correct(you need to use backgroundImage along with setShadowImage) but I wonder why it's not work, what is the result?, it appear to be nothing happen? – piam Nov 12 '12 at 11:41
-
The app crashes when I run the code, and I got -[UITabBar setShadowImage:]: unrecognized selector sent to instance 0x9493990 ..... *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITabBar setShadowImage:]: unrecognized selector sent to instance 0x9493990' *** First throw call stack: – Muhannad Dasoqie Nov 12 '12 at 11:44
-
it's work just fine by using this code [self.tabbarController.tabBar setSelectionIndicatorImage:[UIImage imageNamed:@"Selected_Tab_Shadow.png"]]; ..... but also your efforts are much appreciated, so please edit your answer with this code in order to accept :) – Muhannad Dasoqie Nov 12 '12 at 12:01
-
@MuhannadDasoqie +1 for you too :) – piam Nov 12 '12 at 14:12
1
See this tutorials and source codes for custom tab bar.
there is multi-Example and there is one for custom shadow.
hope that help u.

Omarj
- 1,151
- 2
- 16
- 43
-
-
Thanks Omar again, the provided link is so helpful and imaginantion – Muhannad Dasoqie Nov 13 '12 at 06:57