gpt4 book ai didi

ios - Whatsapp 类型编辑按钮 IOS master detail app

转载 作者:行者123 更新时间:2023-11-29 03:27:01 24 4
gpt4 key购买 nike

我正在使用主详细信息模板开发一个应用程序。这里我默认有“编辑”和“添加”按钮。谁能指导我如何将默认编辑按钮更改为带有边框图像的编辑按钮,就像 Whatsapp 和 oblige 中的那样。

最佳答案

使用此代码:

UIImage* image_bk = [UIImage imageNamed:@"whatsAPP_image.png"];
CGRect frameimg = CGRectMake(0, 0, image_bk.size.width, image_bk.size.height);
UIButton *someButton = [[UIButton alloc] initWithFrame:frameimg];
[someButton setBackgroundImage:image_bk forState:UIControlStateNormal];
[someButton addTarget:self action:@selector(editAction)
forControlEvents:UIControlEventTouchUpInside];
[someButton setShowsTouchWhenHighlighted:YES];

UIBarButtonItem *customEditButton =[[UIBarButtonItem alloc] initWithCustomView:someButton];
self.navigationItem.leftBarButtonItem=customEditButton;

关于ios - Whatsapp 类型编辑按钮 IOS master detail app,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20328218/

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