gpt4 book ai didi

ios - iOS 7.0.3 中的条形半透明消失了

转载 作者:IT王子 更新时间:2023-10-29 07:42:55 26 4
gpt4 key购买 nike

比较两个截图:

在 iOS 7.0 模拟器上完成

enter image description here

以及在 iOS 7.0.3 iPhone 4S 上完成的那个:

enter image description here

到处都是相同的代码和相同的东西!知道为什么半透明在真实设备上消失了吗?

我有这段代码来模拟它(我知道这可能很尴尬而且不正确,但事实就是如此):

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 应用程序中存在相同的行为。

更新

在带有 iOS 7.0.3 模拟器的 Xcode 5.0.1 上,我们有这个(这与您看到的 iOS 7.0 模拟器上的第一张图片不同):

enter image description here

最佳答案

好的,所以在对颜色进行了更多尝试之后,我设法通过模糊获得了类似的外观!

之前,我在导航栏外观上设置了一个 barTintColor,它具有以下值:

R:17高度:63乙:95答:1

这在 iOS < 7.0.3 中很好,导航栏中的输出颜色(带有模糊效果)实际上是:

R:62高度:89乙:109

从 iOS 7.0.3 开始,barTintColor 似乎考虑了我们设置的颜色的 alpha 值。这意味着导航栏实际上输出的是纯色 17、63、95,并且没有模糊效果。

恢复模糊效果的关键是在 barTintColor 中设置 alpha < 1。

经过大量猜测和尝试不同的 RGB 值后,我设法使用以下 RGBA 从导航(和标签)栏获得完全相同的 RGB 输出:

R:4.5高度:61.6乙:98A:0.65

看起来没有什么神奇的比例可以应用到以前的颜色来获得新的颜色。

无论如何,我实际上已经拒绝了今天下午获得批准的二进制文件,并重新提交了这些新值,这样用户就不会得到一个丑陋的应用程序:)

希望这对您有所帮助。

关于ios - iOS 7.0.3 中的条形半透明消失了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19534473/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com