gpt4 book ai didi

objective-c - 我怎样才能使 NSWindow setFrame : . 。动画 :YES] function animated down instead of up?

转载 作者:太空狗 更新时间:2023-10-30 03:56:51 26 4
gpt4 key购买 nike

当我调用我的 [window setFrame: frame animated:YES] 来放大窗口时,它工作得很好,但它会动画化,并且会落后于状态栏。我怎样才能使窗口向下动画?

最佳答案

只需将 y 坐标减小与增加高度相同的距离即可。

CGFloat amountToIncreaseWidth = 100, amountToIncreaseHeight = 100;
NSRect oldFrame = [window frame];
oldFrame.size.width += amountToIncreaseWidth;
oldFrame.size.height += amountToIncreaseHeight;
oldFrame.origin.y -= amountToIncreaseHeight;
[window setFrame:oldFrame animated:YES];

关于objective-c - 我怎样才能使 NSWindow setFrame : . 。动画 :YES] function animated down instead of up?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4639532/

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