比較兩個截圖:酒吧半透明的的iOS 7.0.3了
完成在iOS 7.0模擬器
而且一個在iOS 7.0.3 iPhone 4S做:
相同的代碼在這裏,那裏和相同的東西!任何想法爲什麼半透明性在真實設備上消失了?
我有這樣的代碼來模擬它(我知道這可能是尷尬的,不正確的,但是這就是它是):
topMenuView = [[UIView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, 0, self.view.frame.size.width, TOP_BAR_ORIG_HEIGHT)];
topMenuView.clipsToBounds = YES;
UIToolbar *topMenuViewBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, -4, self.view.frame.size.width, TOP_BAR_ORIG_HEIGHT + 4)];
topMenuViewBar.barStyle = UIBarStyleDefault;
topMenuViewBar.barTintColor = [BSFunctions getColorFromHex:@"1ea6ff"];
const CGFloat statusBarHeight = 20;
UIView *underlayView = [[UIView alloc] initWithFrame:CGRectMake(0, -statusBarHeight, topMenuViewBar.frame.size.width, topMenuViewBar.frame.size.height + statusBarHeight)];
[underlayView setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)];
[underlayView setBackgroundColor:[BSFunctions getColorFromHex:@"1ea6ff"]];
[underlayView setAlpha:0.36f];
[topMenuViewBar insertSubview:underlayView atIndex:1];
UIView *underlayView2 = [[UIView alloc] initWithFrame:CGRectMake(0, -statusBarHeight, topMenuViewBar.frame.size.width, topMenuViewBar.frame.size.height + statusBarHeight)];
[underlayView2 setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)];
[underlayView2 setBackgroundColor:[BSFunctions getColorFromHex:@"0291ff"]];
[underlayView2 setAlpha:0.36f];
[topMenuViewBar insertSubview:underlayView2 atIndex:2];
[topMenuView addSubview:topMenuViewBar];
[self.view addSubview:topMenuView];
主要的一點是它使用在設備上之前的工作!但iOS 7.0.3出來後,它發生了變化。我注意到Facebook和Fitocracy iOS應用中的相同行爲。
UPDATE
上的Xcode 5.0.1與iOS 7.0.3模擬器,我們有這個(這是在iOS 7.0模擬器,你可以看到第一個圖像不同):
您是否關閉了iPhone中的輔助功能和動作? – Fogmeister
正如Fogmeister建議的那樣,請檢查[輔助功能>增加對比度]的設置(http://www.macworld.com/article/2048738/get-to-know-ios-7-changes-in-the-settings-app.html ),這會降低半透明度。 –
@Fogmeister不,沒有任何改變。我認爲模擬器上沒有這樣的選項。 –