gpt4 book ai didi

iphone - 编辑完成后是否有 `setEditing` 的倒数?

转载 作者:行者123 更新时间:2023-12-03 20:59:33 24 4
gpt4 key购买 nike

我正在开发传统的 iPhone UINavigationController 应用程序,带有自动后退按钮等。

我正在研究按下“编辑”按钮时的情况。左侧后退图标变暗,我的新图标出现,然后一旦我再次点击“编辑”按钮,后退按钮就会回来。

到目前为止,后退按钮消失了,我的新按钮进来了,但我无法将其放回去!我知道代码应该是什么,但我不知道在哪里调用它。

这是我到目前为止所拥有的:

 (void)setEditing:(BOOL)editing animated:(BOOL)animated {
[self.navigationItem setHidesBackButton:editing animated:animated]; //fades back button

//de 006 - Load in Move section button here.
UIBarButtonItem *saveButton = [[[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemOrganize
target:self action:@selector(altersection:)] autorelease];

self.navigationItem.leftBarButtonItem = saveButton;

基本上我想要的是(void)setEditing:(BOOL)editingAnimated:(BOOL)animated{的逆,我可以这样做:

self.navigationItem.leftBarButtonItem = nil;   //custom button hide
self.navigationItem.hidesBackButton = NO; //replace back button

是否存在 (void)setEditing:(BOOL)editing 的反函数?

最佳答案

不确定我完全理解这个问题:/

当您按下“完成”按钮时,我相信setEditing会再次被调用,但NO作为编辑 参数。

所以在 setEditing 中你可以检查:

if(editing) { .... }

查看我们是否正在进入或离开编辑状态。

关于iphone - 编辑完成后是否有 `setEditing` 的倒数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2093655/

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