gpt4 book ai didi

ios - 从 iOS 导航后栏按钮中删除文本。

转载 作者:行者123 更新时间:2023-11-29 03:45:54 25 4
gpt4 key购买 nike

我想从导航栏左侧按钮中删除文本,但我到处都找遍了,但找不到任何东西。我希望按钮只显示图像,它确实做到了这一点,但文本覆盖在它上面。如何删除文字?

最佳答案

UIImage* image = [UIImage imageNamed:@"yourImage"];
CGRect frameimg = CGRectMake(0, 0, image.size.width, image.size.height);
UIButton *yourButton = [[UIButton alloc] initWithFrame:frameimg];
[yourButton setBackgroundImage:image forState:UIControlStateNormal];
UIBarButtonItem *button =[[UIBarButtonItem alloc] initWithCustomView:yourButton];
self.navigationItem.rightBarButtonItem=button;

关于ios - 从 iOS 导航后栏按钮中删除文本。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17765910/

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