gpt4 book ai didi

objective-c - 动态改变 UITableViewCell 的附属 View 图像

转载 作者:行者123 更新时间:2023-11-28 22:45:50 25 4
gpt4 key购买 nike

我有一个 CustomTableView Cell,它有一个附属 View 。如何动态更改附件 View 的图像?

最佳答案

将您的自定义按钮用于附件 View ,例如..

//把铅笔图标贴在辅助 View 上

UIButton* pencil = [UIButton buttonWithType:UIButtonTypeCustom];
[pencil setImage:[UIImage imageNamed:@"icon-pencil.gif"] forState:UIControlStateNormal];
pencil.frame = CGRectMake(0, 0, 15, 15);
pencil.userInteractionEnabled = YES;
[pencil addTarget:self action:@selector(didTapEditButton:) forControlEvents:UIControlEventTouchDown];
cell.accessoryView = pencil;

关于objective-c - 动态改变 UITableViewCell 的附属 View 图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13235768/

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