How to I style a UIToolbar to look like the standard iPhone camera toolbar?
The iPhone开发者_如何学Python camera toolbar is gray and has a slight gradient. I believe I could achieve the same look by setting the tintColor and/or translucency of the toolbar.
Any idea how I could make my toolbar look exactly like the camera one?
This isn't quite right... too dark:
UIToolbar *tb = [[UIToolbar alloc] initWithFrame:frame];
tb.tintColor = [UIColor grayColor];
try
tb.barStyle = UIBarStyleBlack;
or
tb.barStyle = UIBarStyleBlackTranslucent;
Does setting the toolbar's barStyle property to UIBarStyleBlackTranslucent give you the effect you want?
this works for me on iOS 7.1
tb.barStyle=-1;
tb.backgroundColor=[[UIColor blackColor]colorWithAlphaComponent:0.2];
精彩评论