iOS开发中全局修改UINavigationBar的样式

树莓派34/100 - Pico读取MPU6050加速度和陀螺仪传感器数据 树莓派Pico连接MPU-6050模块(三轴陀螺仪+三轴加速度),读取运动姿态数据。 阅读详情

iOS开发中全局修改UINavigationBar的样式

本文主要介绍在开发中, 我们遇到需要修改UINavigationBar样式的时候, 一种全局的修改方式, 而且非常高效, 适用, 希望对大家有帮助.

前言

在iOS开发中, 我们会经常跟UINavigationController打交道, 那么修改UINavigationBar样式的事情也是经常遇到的, 我之前的做法就是: 在每个childViewController中, 逐个修改样式, 添加leftBarButtonItem 和 rightBarButtonItem等, 就像下面代码这样:

    self.navigationController.navigationBar.barTintColor = [UIColor whiteColor];
    self.navigationController.navigationBar.tintColor = [UIColor blackColor];

这样的做法是非常低效的, 而且每个childController我们都需要设置, 如果我们需要自定义返回按钮, 这样的设置方式也是行不通的, 这种方式也会产生很多意想不到的问题, 相信使用过的朋友都有类似的经历.

接下来, 介绍一种合理的设置方式:

全局设置

这种方法就是通过[UINavigationBar appearance]和[UIBarButtonItem appearance]来进行全局的设置, 下面贴出一段我设置的代码:

    [[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]];

    [UINavigationBar appearance].titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor whiteColor]};

    [UINavigationBar appearance].backIndicatorImage =
    [UINavigationBar appearance].backIndicatorTransitionMaskImage =
    [UIImage templateImageNamed:@"nav_bar_back_icon_white"];

    [[UINavigationBar appearance] setBarTintColor:MMA_BLACK(1)];
    [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
    // hide title of back button
    [[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60)
                                                         forBarMetrics:UIBarMetricsDefault];

    NSShadow *clearShadow = [[NSShadow alloc] init];
    clearShadow.shadowColor = [UIColor clearColor];
    clearShadow.shadowOffset = CGSizeMake(0, 0);

    UIColor *normalTitleColor = [UIColor whiteColor];
    UIColor *highlightedTitleColor = [UIColor whiteColor];
    [[UIBarButtonItem appearance] setTitleTextAttributes:@{
                                                           NSForegroundColorAttributeName : normalTitleColor,
                                                           NSShadowAttributeName : clearShadow
                                                           } forState:UIControlStateNormal];
    [[UIBarButtonItem appearance] setTitleTextAttributes:@{
                                                           NSForegroundColorAttributeName : highlightedTitleColor,
                                                           NSShadowAttributeName : clearShadow
                                                           } forState:UIControlStateHighlighted];

    [[UIBarButtonItem appearance] setTintColor:[UIColor whiteColor]];

    [[UIToolbar appearance] setBarTintColor:[UIColor whiteColor]];

这个就需要我们在程序启动的时候设置, 也就是在- (BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions 中设置, 这种设置方法的好处就是:

1.只需要设置一次, 不需要再每个childController中逐个设置

2.可以保证UINavigationBar的风格一致

3.通过这种方式可以自定义UINavigationController的返回键

总的来说, 建议大家通过这种方式设置, 这样其实能够很大程度上提高开发效率.

总结

建议大家讲上述设置代码, 写进UINavigationBar的Category中, 这样我们就可以实现复用, 这也是一种很好的编程习惯. 希望本文对在UINavigationBar样式设置上遇到问题的同学有帮助.

STM32入门教程:智能储物柜控制 在这个例子中,我们将使用一个4x4的储物柜,共有16个储物格。我们了解了硬件准备、储物柜电路设计、STM32的基本配置、储物柜控制代码的编写以及测试和调试等方面的知识。根据我们的电路设计,我们需要将一些引脚配置为输出,并将其他引脚配置为输入。在本教程中,我们将使用STM32微控制器来实现一个基本的智能储物柜控制系统。在主函数中,我们将不断循环读取传感器数据,并根据数据的变化来控制储物柜的开关和显示相关信息。这个函数将读取人体感应传感器、温湿度传感器和光照传感器的数据,并将数据存储到相应的变量中。 阅读详情

相关推荐

新手小白 必须精进的 “ FLASH分区管理Code and Data ” !!!最强文章解析!!!

FLASH“代码区”和“数据区”不是每个项目都必须显式管理,但只要你的产品功能越来越丰富,对可靠性和扩展性要求提高,就一定要学会科学划分和使用。这也是嵌入式工程师进阶路上的必修课!

qq_75157958的博客 938

在iOS应用中如何更优雅的使用的导航栏(UINavigationBar)

那么上面系统导航栏存在的问题,该怎么解决呢?其实系统提供的导航栏本身也可以解决这些问题,它的返回按钮可以重新设置,它的背景颜色也可以根据不同的视图控制器进行修改,TabBar也可以根据页面的层级进行手动隐藏和显式,但是这需要写很多的代码,很多的重复代码。而且在实际开发中,我们往往不会采用这种方式,毕竟费力不讨好。那么该如何设置导航导航了,才能更优雅的解决这些问题呢?这时候自定义导航栏就该登场了。/// 标题didSet {/// 是否显示返回按钮didSet {/// 返回点击回调。

weixin_39339407的博客 2088

避开未来函数陷阱:通达信烽火起爆指标优化版配置全流程

本文详细解析了通达信烽火起爆指标的优化版配置流程,重点解决了原始指标中的未来函数风险问题。通过均线共振系统、量价配合模块和信号过滤系统的深度优化,确保指标信号的稳定性和可靠性。文章还提供了专业的导入配置指南、历史回测方法论以及多周期协同交易策略,帮助投资者有效避开未来函数陷阱,提升实战应用效果。

ipfs8storage的博客 820

iOS:UINavigationBar appearance与UIBarButtonItem appearance简介

[UINavigationBar appearance]与[UIBarButtonItem appearance]使用方法基本相同。 [UIBarButtonItem appearance] 设置导航条左右两边item的文字样式 [UINavigationBar appearance] 设置导航条title,整个导航条颜色背景等 方法总结: UINavigationBar: 1.设置颜色 [[UI

寻梦之路 1118

react-window 大数据列表和表格数据渲染组件之虚拟滚动

ReactWindow是一个高性能的React虚拟滚动组件库,专门用于高效渲染大型列表和表格数据。它通过“窗口化”技术,仅渲染用户可见区域的内容,大幅提升性能并减少内存消耗。主要特点包括:支持固定/可变大小列表项、多种布局类型(垂直/水平/网格)、轻量级设计(不足5KB)以及平滑的滚动体验。相比传统渲染方式,它能轻松处理成千上万条数据,并提供自动滚动、自适应容器大小等高级功能。与同类库相比,ReactWindow具有更简洁的API和更优的性能表现,是处理大数据量渲染场景的理想选择。

前端开发-前端技术分享 1141

sap外币重估流程图_SAP 外币评估方法(Valuation Method,评估方法)

在FI-GL模块评估外币时(T-code:F.05),需要输入ValuationMethod。下面分解一下评估方法是如何定义的。IMG -> FI -> General LedgerAccounting ->Business Transactions ->Closing ->Valuating -> ForeignCurrency Valuation ->...

weixin_39640543的博客 2363

UIAppearance的使用

iOS5及其以后提供了一个比较强大的工具UIAppearance,我们通过UIAppearance设置一些UI的全局效果,这样就可以很方便的实现UI的自定义效果又能最简单的实现统一界面风格,它提供如下两个方法。 + (id)appearance 这个方法是统一全部改,比如你设置UINavBar的tintColor,你可以这样写:[[UINavigationBar appearance] setT

ideas press的专栏 555

Tessent ATPG进阶:解锁多种Fault Model的工程实践与选型指南

本文深入探讨Tessent ATPG中多种Fault Model的工程实践与选型策略,涵盖Stuck-at、Transition、Bridge等核心模型的应用场景与配置技巧。通过实际案例解析,展示如何组合不同Fault Model提升芯片测试覆盖率,特别针对汽车电子、超低功耗芯片等复杂场景提供专业解决方案。

weixin_30219613的博客 207

Navigation Bar 修改问题(三) ----- 系统重启Launcher界面显示Nv Bar

在实际的应用中,发现没有Navigation Bar的横屏Launcher在重新启动后的第一次显示,会把NavigationBar显示出来, 具体的Navigation Bar的改动可以参照上面的相关的两篇文章: Navigation Bar开机后显示和隐藏 (一) Navigation Bar 修改问题(二)------ Launcher与应用之间切换 这里解释一

金佳杰 1690

MATLAB和S7-1200PLC水箱液位高度PID控制联合仿真(KEPserverOPC通信应用)

SMART PLC 向导PID的详细介绍请查看下面文章链接:S7-200 SMART PLC PID向导详细介绍(如何实现P、PD、PID控制器)-CSDN博客文章浏览阅读1k次。这篇博客主要介绍SMART PLC PID向导的使用,PID控制相关的其它内容请查看专栏系列文章,常用链接如下:SMART PLC PID负压控制(过程量为负数)_负压控制pid控制程序_RXXW_Dor的博客-CSDN博客1、如何实现PID反作用调节?S7-1200PLC和KEPserver OPC通信-CSDN博客。

RXXW_Dor的博客 1791

基于NB-IoT的智慧路灯监控系统(NB-IoT专栏—实战篇1:项目简介)

基于NB-IoT技术的城市道路智慧路灯监控系统,在每个照明节点上安装一个集成了NB-IoT模组的单灯控制器,单灯控制器再经运营商的网络,与路灯控制平台实现双向通信,路灯控制平台直接对每个灯进行控制,包括开关灯控制、光照检测、自动调节明暗、电耗分析等操作。

不脱发的程序猿 5万+

解决键盘弹起时把UINavigationBar顶出屏幕外面的问题

UI的最底部有一个悬浮的UITextField评论框,当点击它时键盘弹起,会把UINavigationBar顶出屏幕外面去,解决办法如下: - (void)viewDidLoad { [super viewDidLoad]; // 防止NavigationBar被键盘弹起时顶出屏幕外面 UIScrollView *scrollView = [[UIScrollV

坚持自己! 3429

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

ios - UINavigationBar添加背景图片的几种简单思路

UITabBarController下面常常需要为多个ViewController设置导航栏样式,总结了一下遇到过的为UINavigationBar添加背景图片的几种简单思路 以设置背景图片为例: 第一种,直接在视图里面单独设置每个视图的UINavigationBar,适合每个页面需要不同的导航栏样式。 [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"nav_bg_all-64"]...

wyz670083956的博客 1423

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

iOS 全局修改UINavigationBar的返回按钮(适配 iOS 11)

前言 关于实现 App 全局统一样式的返回按钮,之前我们通过修改 [[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:] 来改变返回按钮中文字的偏移量,来实现隐藏文字的效果。但是改完后不是很满意,给大家两张图感受一下 ←iOS10 ←iOS11 很明显,iOS 11以下,即使隐藏了文字,但是如果原本文字过长依旧...

weixin_33800593的博客 1086

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

[iOS diary]iOS6样式兼容之 NavigationBar和TabBar 样式扁平化 兼容iOS7样式 全局实现

[[UITabBar appearance] setTintColor:[UIColor clearColor]];

kelvict的专栏 1898

iOS 全局修改UINavigation 后退按钮

快两年没有更新blog了,现在有点时间随便写点东西吧。 做iOS项目中,可能会经常遇到要定制后退按钮的情况,比如把后退按钮的title固定为“返回”(修改title对后面push的vc生效),比如用图片,这时候大家一般会选择添加一个vc的基类,因为这个问题其实很简单,随便做点什么都能解决,今天我用另一种优雅的方法来解决这个问题。 默认iOS7的后退按钮是一个箭头+文字,如果想只要箭头的

Bannings的专栏 2万+

UINavigationBar 使用总结

UINavigationBar是我们在开发过程中经常要用到的一个控件,下面我会为大家介绍一些常用的用法。 1. 设置导航栏的标题 这个不多说,直接上代码 self.navigationItem.title = @"UINavigationBar使用总结"; 2. 设置导航栏的背景颜色 //通过barTintColor来设置背景色 self.navigationContr

zanshiyonghuming的博客 828

UINavigationBar的结构

ios中导航栏是开发中常用到的,之前从没有关注过导航栏里面的具体结构。今天抽空具体了解了一下 UINavigationBar的父view是一个叫做UILayoutContainerView的视图,该视图对应的控制器就UINavigationController。 UINavigationController主要三个部分: navigationBar viewcontrollers too...

a1034386099的博客 1495

自定义UINavigationBar

一、UINavigationBar的背景自定义图片       要实现navigationBar的背景自定义图片,是直接定义一个UINavigationBar的category,并重写drawRect方法。     (1)方法一:修改全局的UINavigationBar背景自定义图片(利用分类重写drawRect:方法)(适用用IOS5以下) 修改方法的具体代码如下:

zeng11088的专栏 1009

对于修改TabBar和NavigationBar全局背景颜色、字体颜色的两个方法

//全局修改UITabBar //    TabBar 的字体颜色 //    [[UITabBar appearance]setTintColor:[UIColor blackColor]]; //    TabBar 的背景颜色         [[UITabBar appearance]setBarTintColor:[UIColor colorWithRed:7

comeonword的博客 937

UINavigationBar的几条使用方法

1:  修改导航控制器背景图片的方式(IOS5以上)1[[UINavigationBar appearance] setBackgroundImage:image forBarMetrics:UIBarMetricsDefault];注: 通过appearance可以设置全局的控件初始化外观.不过在初始化成功以后,有单独样式需求亦可用同样的方法修改.UINavigationBar的标准高度是44,

TaidyPanda的专栏 749

iOS UIAppearance 全局设置详解

iOS5及其以后提供了一个比较强大的工具UIAppearance,我们通过UIAppearance设置一些UI的全局效果,这样就可以很方便的实现UI的自定义效果又能最简单的实现统一界面风格,它提供如下两个方法。 + (id)appearance 这个方法是统一全部改,比如你设置UINavBar的tintColor,你可以这样写:[[UINavigationBar appearanc

txl444363699的专栏 665

实习小结——UIBarButtonItem和UINavigationBar的坑

这一周做了很多UI方面的东西,遇到的坑主要集中在UIBarButtonItem和UINavigationBar,记录一下备查。UIBarButtonItem自定义位置直接用系统默认的方式生成按钮是无法选择位置的,甚至连这个按钮的默认位置都不清楚。如果想要自定义按钮的位置,有两种选择。一、直接修改系统生成的按钮。可以通过UIBarButtonItem的imageInsets属性,修改图片的位置,从而间

KT的iOS开发小站 3420

iOS 全局设置系统导航栏返回按钮样式

前言 我之前有写过一个关于全局设置导航栏返回按钮的文章,在这里。通过类别的方式,直接导入文件即可生效。但是有几点不便之处:一是没有暴露接口去设置返回按钮的样式,默认样式直接写在类的方法实现中;二是没有使用 cocoapods 管理,不符合工具类组件化管理的原则。因此做了二次修改。 使用 直接使用 pod 导入 pod 'MERNavigationBackItem' 默认返回按钮文字为 “返回”...

weixin_34023863的博客 1627

xcode13环境下iOS15兼容问题汇总

一、调用canOpenURL的差异 通过xcode13运行的APP,在iOS15系统上会限制info.plist的scheme白名单个数,前50个scheme有效,如果超出50个,调用canOpenURL会一直返回NO,无论你的手机是否安装该URL Scheme的应用。 苹果官网对canOpenURL方法的调整做了说明,希望APP内减少对scheme的依赖,通过Universal Link的方式去实现应用跳转。 /// 手机安装了美团APP,如果imeituan添加在列表的第49个,isInstal

风·之痕的博客 7033

UIToolbar UINavigationController UINavigationBar UIBarButtonItem

--------------------------------------------------------------------------------UIBarButtonItem-------------------------------------------------------------------------------- 1:  UIBarButtonItem 隐

余书懿 6580
上一篇: iOS开发推送小结
下一篇: 阿里电话二面总结
wlaizff
博客等级 码龄12年 9粉丝 40原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值