当前位置:网站首页>Swift return button
Swift return button
2022-06-21 13:26:00 【Born like the wind】
1、 Left Icon + written words

private lazy var backButton: UIButton = {
let button = UIButton()
button.setImage(ImageLoader.image(named: "back"), for: .normal)
button.imageView?.contentMode = .scaleAspectFit
button.imageEdgeInsets = UIEdgeInsets(top: 0, left: 8, bottom: 0, right: 0)
button.titleEdgeInsets = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: -16)
button.setTitle(NSLocalizedString("SETTINGS", comment: ""), for: .normal)
button.addTarget(self, action: #selector(backOnTapped), for: .touchUpInside)
button.setTitleColor(.mainTextColor, for: .normal)
button.titleLabel?.font = UIFont.systemFont(ofSize: 18.0)
return button
}()
2、 Left return Icon , Center the title

public override func viewDidLoad() {
...
navigationItem.titleView = titleView
navigationController?.navigationBar.topItem?.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)
...
}
private lazy var titleView: UILabel = {
let label = UILabel()
label.text = NSLocalizedString("Add Friend", comment: "Add friend")
label.textColor = .mainTextColor
label.font = .systemFont(ofSize: 18.0)
return label
}()
边栏推荐
- 应用配置管理,基础原理分析
- 不止于ZeRO:BMTrain技术原理浅析
- Distributed transaction processing scheme big PK
- [course assignment] floating point operation analysis and precision improvement
- 如何使用搜索引擎?
- SCCM creates a client collection based on the installed app and periodically pushes application updates
- The new plan for national treasures - the exclusive digital collection of the four museums is coming!
- Babbitt yuancosmos daily must read: wechat may ban a official account for the first time on the grounds of "involving secondary transactions in digital collections", and the new regulations of the pla
- Convert DICOM format to nii GZ file
- Hot information of Tami dog: Xiamen property right trading center creates its first time again!
猜你喜欢

###数据库的高可用配置(mysql)

塔米狗分享:产权交易的方式及其产权交易市场数据化意义

应用配置管理,基础原理分析

分布式事务处理方案大 PK
![[deeply understand tcapulusdb technology] tmonitor background one click installation](/img/0a/742503e96a9b51735f5fd3f598b9af.png)
[deeply understand tcapulusdb technology] tmonitor background one click installation

《网络是怎么样连接的》读书笔记 - ADSL

SCCM基于已安装的 APP创建客户端集合并定期推送应用更新

3D slicer saves segmentation results

【深入理解TcaplusDB技术】TcaplusDB导入数据

3D slicer import label and view label
随机推荐
cartographer_ ceres_ scan_ matcher_ 2d
5. array
启牛商学院app下载证券开户,是安全的吗?有风险嘛?
Not only zero:bmtrain technology principle analysis
618 Nuggets digital collection? Burberry and other luxury brands fight against metauniverse
PHP uses grafika to synthesize pictures and generate poster images
Work content of service governance
How to use search engine?
《预训练周刊》第50期:无解码变换器、神经提示搜索、梯度空间降维
What do you mean by concurrency, concurrency, and high concurrency?
What is Devops in an article?
高效远程办公手册| 社区征文
Annual special analysis of China Mobile Banking in 2022
【深入理解TcaplusDB技术】TcaplusDB业务数据备份
【深入理解TcaplusDB技术】TcaplusDB导入数据
MySQL constraints (descriptions of various conditions when creating tables)
CVPR2022 | 上科大x小红书首次提出动作序列验证任务,可应用于体育赛事打分等多场景
Explanation of common mesh generation methods in workbench
Collection reference type in JS
不止于ZeRO:BMTrain技术原理浅析