gpt4 book ai didi

ios - 个人热点打破 UI 布局

转载 作者:行者123 更新时间:2023-12-01 18:40:11 25 4
gpt4 key购买 nike

当个人热点被激活并且 bar 将自身大小调整为 40 像素时, View 不会正确调整大小。底部在屏幕下方 20 像素处,而不是调整大小。

我在我的所有 View Controller 中都使用了自动布局,但即使我的应用程序 UI 中断,如下图所示。
enter image description here

任何帮助都会很棒。!

最佳答案

在您的 viewdidload 中注册此通知

- (void)viewDidLoad {
[super viewDidLoad];

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(statusBarFrameWillChange:)name:UIApplicationWillChangeStatusBarFrameNotification object:nil];
}



- (void)statusBarFrameWillChange:(NSNotification*)notification
{
NSLog(@"STATUS BAR UPDATED");
int statusHeight = [UIApplication sharedApplication].statusBarFrame.size.height;
NSLog(@"status bar height %d", statusHeight);
// Here you can do your constraint adjustments accordingly
}

你可以在这里找到一个很好的教程(快速) http://studyswift.blogspot.in/2015/12/adjust-ui-components-programmatically.html

关于ios - 个人热点打破 UI 布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44537654/

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