Transparent UIView like photo gallery app in iphone
The default camera app has a photo gallery which has glossy and transparent look, especially the toolbar. One can see the image partially behind开发者_C百科 the toolbar. How is this achieved? Is it just by altering the opaque property of UIView? Any pointers are much appreciated.
Just change the style of the status bar and the navigation bar.
-(void)viewWillAppear:(BOOL)animated_
{
[super viewWillAppear:animated_];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent];
[[[self navigationController] navigationBar] setBarStyle:UIBarStyleBlackTranslucent];
[self setWantsFullScreenLayout:YES];
}
-(void)viewWillDisappear:(BOOL)animated_
{
[super viewWillDisappear:animated_];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackOpaque];
[[[self navigationController] navigationBar] setBarStyle:UIBarStyleDefault];
}
精彩评论