gpt4 book ai didi

iphone - 如何更改自动生成的导航栏 Xcode

转载 作者:行者123 更新时间:2023-11-29 04:15:13 26 4
gpt4 key购买 nike

我有超过 5 个选项卡,因此给了我一个带有导航栏的表格 View 单元格。如何更改表格 View 单元格和导航栏。

最佳答案

您可以像下面的 UITableView 委托(delegate)方法一样设置 UITableView 单元格颜色:-

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {


cell.backgroundColor = [UIColor colorWithRed:204/255.0 green:0/255.0 blue:0/255.0 alpha:0.1];

您可以手动设置 UINavigationBar 上的后退按钮,只需将以下代码放入 ViewDidLoad 方法中,例如:-

UIImage* imageback = [UIImage imageNamed:@"Back_Button.png"];
CGRect frameimgback = CGRectMake(0, 0, 50, 30);
backButton = [[UIButton alloc] initWithFrame:frameimgback];
[backButton setBackgroundImage:imageback forState:UIControlStateNormal];
[backButton addTarget:self action:@selector(goBack:)
forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *btn = [[UIBarButtonItem alloc]initWithCustomView:backButton];
self.navigationItem.leftBarButtonItem = btn;

希望对你有帮助,谢谢

关于iphone - 如何更改自动生成的导航栏 Xcode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13812273/

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