标签:des android style http io ar color os 使用
view.layer.masksToBounds = YES;
,Read more.UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapDetected)]; singleTap.numberOfTapsRequired = 1; [self.logoImageView setUserInteractionEnabled:YES]; [self.logoImageView addGestureRecognizer:singleTap];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationDidChange:) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];
UIDeviceOrientation orientation = [UIDevice currentDevice].orientation; if (!UIDeviceOrientationIsLandscape(orientation)) { topLayoutGuide = 20.0; }
You can do this without writing any line of code!
Do the following to make the status bar text color white through the whole app
On you projectplist
file:Status bar style
:UIStatusBarStyleLightContent
View controller-based status bar appearance
:NO
Status bar is initially hidden
:NO
[UIApplication sharedApplication].statusBarFrame.size.height. But since all sizes are in points, not in pixels, status bar height always equals 20.
Update. Seeing this answer being considered helpful, I should elaborate.
Status bar height is, indeed, equals 20.0f points except following cases:
status bar has been hidden with setStatusBarHidden:withAnimation: method and its height equals 0.0f points;
as @Anton here pointed out, during an incoming call outside of Phone application or during sound recording session status bar height equals 40.0f points.
There‘s also a case of status bar affecting the height of your view. Normally, the view‘s height equals screen dimension for given orientation minus status bar height. However, if you animate status bar (show or hide it) after the view was shown, status bar will change its frame, but the view will not, you‘ll have to manually resize the view after status bar animation (or during animation since status bar height sets to final value at the start of animation).
Update 2. There‘s also a case of user interface orientation. Status bar does not respect the orientation value, thus status bar height value for portrait mode is [UIApplication sharedApplication].statusBarFrame.size.height (yes, default orientation is always portrait, no matter what your app info.plist says), for landscape - [UIApplication sharedApplication].statusBarFrame.size.width. To determine UI‘s current orientation when outside of UIViewController and self.interfaceOrietation is not available, use [UIApplication sharedApplication].statusBarOrientation.
Update for iOS7. Even though status bar visual style changed, it‘s still there, its frame still behaves the same. The only interesting find about status bar I got – I share: your UINavigationBar‘s tiled background will also be tiled to status bar, so you can achieve some interesting design effects or just color your status bar. This, too, won‘t affect status bar height in any way. Read more
标签:des android style http io ar color os 使用
原文地址:http://my.oschina.net/javaTechLover/blog/348887