iOS 6的樣子......如何設置狀態欄背景色的iOS 7
同樣我也想在iOS的7顯示狀態欄像
看到這個
我的實際輸出(重疊)
我曾嘗試下面的邏輯
open your info.plist and set "View controller-based status bar appearance" = NO
它不是在我的代碼工作,,,
iOS 6的樣子......如何設置狀態欄背景色的iOS 7
同樣我也想在iOS的7顯示狀態欄像
看到這個
我的實際輸出(重疊)
我曾嘗試下面的邏輯
open your info.plist and set "View controller-based status bar appearance" = NO
它不是在我的代碼工作,,,
你必須做兩件事情。首先是打開你的info.plist
並設置"View controller-based status bar appearance" = NO
而第二個是這行添加到application:didFinishLaunchingWithOptions
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7)
{
self.window.clipsToBounds = YES;
[[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleBlackOpaque];
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
if(orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight)
{
self.window.frame = CGRectMake(20, 0,self.window.frame.size.width-20,self.window.frame.size.height);
self.window.bounds = CGRectMake(20, 0, self.window.frame.size.width, self.window.frame.size.height);
} else
{
self.window.frame = CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20);
self.window.bounds = CGRectMake(0, 20, self.window.frame.size.width, self.window.frame.size.height);
}
}
閱讀這篇文章:http://www.appcoda.com/customize-navigation-status-bar-ios-7/
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
[[UINavigationBar appearance] setBarTintColor:UIColorFromRGB(0x067AB5)];
這些開發人員將圖像放在他們的UINavigationBar上的優秀鏈接。 – capikaw
可悲的是,我的iPad應用程序沒有做太多的工作。良好的鏈接,雖然 – cynistersix
出於某種原因,這不適合我,storyboard,ios7。將該行添加到AppDelegate didFinishLaunching – Fraggle
20個像素向下移動你的框架。您可以在viewWillAppear中嘗試寫這樣或窗口到黑色的applicationDidFinishLaunching的DidAppear
CGRect frame = self.view.frame;
frame.origin.y = 20;
if (self.view.frame.size.height == 1024 || self.view.frame.size.height == 768)
{
frame.size.height -= 20;
}
self.view.frame = frame;
現在設置背景顏色和設置狀態欄字體爲白色(StatusBarContentLight)
記住我的建議是不完美的解決方案但一個修復,將很好地工作。當應用程序改變其方向(ShouldAutorotate)時,也使用相同的代碼
@ swt-他們有很多關於SO的問題,你有沒有搜索過 –