适配iPhone X Push过程中TabBar位置上移

电气工程师必修:PLC编程从入门到实战 可编程逻辑控制器(PLC)是现代工业控制的核心设备,它通过软逻辑替代传统继电器硬接线,实现了从“硬件决定逻辑”到“软件决定逻辑”的转变。理解PLC编程的循环扫描原理、梯形图思维以及定时器、计数器等基本指令,是电气工程师进阶的关键。PLC技术广泛应用于产线设备、机器人工作站、物流输送线等场景,熟练掌握后不仅能改造设备逻辑,还能参与通讯组网和系统联调。从品牌选型、编程环境到实战案例,系统掌握PLC编程能帮助电气工程师突破职业瓶颈,进入核心控制层,实现从设备维护到自动化设计的跨越。 阅读详情

转载自:http://blog.youkuaiyun.com/xuyang844175181/article/details/78134552

就在刚刚GitHub有同学给我提了个Issue,说我的框架在iPhone X上跑有bug,Push新页面的时候TabBar会上移。开玩笑吧?我的框架怎么会有bug,这一定是个误会,于是我去iPhone X跑了一下,哎哟嘿,脸好疼

image.png
image.png

发现问题

来个慢动作:

iPhone X 不完美.gif
iPhone X 不完美.gif

上图可发现,点击跳转的时候,TabBar的确迅速上移了一段距离,没搞懂为啥,也许苹果别有用心,但我在心里还是骂了一下库克等人。

解决问题

在UINavigationController的基类重写pushViewController代理方法,在Push的时候修正一下TabBar的frame

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    if (self.viewControllers.count > 0) {
            viewController.hidesBottomBarWhenPushed = YES;
        }
    [super pushViewController:viewController animated:animated];
    // 修改tabBra的frame
    CGRect frame = self.tabBarController.tabBar.frame;
    frame.origin.y = [UIScreen mainScreen].bounds.size.height - frame.size.height;
    self.tabBarController.tabBar.frame = frame;
}

其他跳动问题解决

在继承于系统UITabBar的子类加上下面代码

#import "XYTabBar.h"

@interface XYTabBar()

@property (nonatomic,assign)UIEdgeInsets oldSafeAreaInsets;

@end

@implementation XYTabBar

- (void) safeAreaInsetsDidChange
{
    [super safeAreaInsetsDidChange];
    if(self.oldSafeAreaInsets.left != self.safeAreaInsets.left ||
       self.oldSafeAreaInsets.right != self.safeAreaInsets.right ||
       self.oldSafeAreaInsets.top != self.safeAreaInsets.top ||
       self.oldSafeAreaInsets.bottom != self.safeAreaInsets.bottom)
    {
        self.oldSafeAreaInsets = self.safeAreaInsets;
        [self invalidateIntrinsicContentSize];
        [self.superview setNeedsLayout];
        [self.superview layoutSubviews];
    }
    
}

- (CGSize) sizeThatFits:(CGSize) size
{
    CGSize s = [super sizeThatFits:size];
    if(@available(iOS 11.0, *))
    {
        CGFloat bottomInset = self.safeAreaInsets.bottom;
        if( bottomInset > 0 && s.height < 50) {
            s.height += bottomInset;
        }
    }
    return s;
}
@end

注意:

如果你的TabBar是非继承自UITabbar的,而是自定义UIView 然后 addSubView到系统的TabBar里的,那上面方法可能无效,之前我的框架就是个UIView,奇葩问题太多,建议要么继承于系统的,要么完全自己实现底部整个TabBar。目前系统提供的UITabbar也不错的,通过重写来支持自定义样式,可以满足大部分APP的需求。

修正完的效果:

iPhone X 完美.gif
iPhone X 完美.gif
React Native路由本质:React Navigation原生导航接管指南 在移动跨端开发中,路由不再只是URL跳转的声明式抽象,而是对iOS UINavigationController和Android FragmentManager等原生导航生命周期的精确控制。React Navigation作为React Native官方唯一背书的导航方案,其核心价值在于将JavaScript指令可靠翻译为原生导航动作,并同步管理动画、状态与内存。理解这一原理,是解决手势返回卡顿、安全区域适配异常、Tab栈丢失等高频问题的前提。尤其当涉及safeareaprovider强制集成与stack/ 阅读详情

相关推荐

ios-超强自定义tabBar (修复iPhone X 适配问题).zip

⊙ 修复iPhone X 适配问题 ⊙ 性能优化 ⊙ 支持自定义tabBar动画 ⊙ 支持自定义tabBar样式 ⊙ 支持自定义badgeValue动画 ⊙ 支持自定义badgeValue样式 ⊙ 完美支持横竖屏 ⊙ 支持CocoaPods 更多说明请移步github github地址: https://github.com/JunAILiang/JMTabBarController 博客地址: https://www.ljmvip.cn

ios tabbar和布局

如下图,你在布局的时候tabbar下面的地方是不包括在内的,不是tabbar遮挡了下面的视图,而是tabbar下面根本没有视图 参考博客: ios(swift)显示和隐藏(收起)tabBar

baidu_40537062的博客 731

iPhoneXTabbar.zip

iPhoneXTabbar 的源码下载 ,你可以下载下来搞一搞。。。

关于xcode26编译老项目导航栏以及tabbar出现异常的解决方案

info.plist 设置 UIDesignRequiresCompatibility 为Yes 即可 ,如有其他方法欢迎交流。更新了Xcode26运行老项目发现显示异常。

weixin_42611061的博客 1141

Keil C51开发必看:详解data/xdata/bdata内存分配陷阱与避坑指南

本文深入解析Keil C51开发中的data/xdata/bdata内存分配陷阱,提供针对51芯片的高效避坑指南。通过真实案例揭示Keil编译器的隐藏规则,分享内存优化策略和调试技巧,帮助开发者解决data溢出、xdata访问异常等典型问题,提升嵌入式开发效率。

v6b7n8m9q0的博客 1071

【接地系统篇】电力系统接地技术详解:从基本原理到实际应用

接地是为电流返回电源提供的一条低阻抗通道。简单来说,就是为故障电流修建一条"安全回家"的路,防止电流通过人体或其他不应带电的部件。接地系统选择原则安全性优先:TN-S系统安全性最高,适合重要场所经济性考虑:TN-C系统成本最低,适合一般工业连续性要求:IT系统供电连续性最好,适合特殊场所灵活性选择:TN-C-S系统兼顾经济与安全,应用最广。

2301_81299416的博客 2223

SwiftUI 6.0(iOS/iPadOS 18)中全新的 Tab 以及 Sidebar+悬浮 TabView 样式

在本篇博文中,我们介绍了 SwiftUI 6.0(iPadOS 18/iOS 18)新标签页中新增的 Tab 和 TabSection 原生视图,并进一步讨论了如何让 TabView 支持 Sidebar 样式以及其它有趣的新特性。

享受开发,颠倒银河 4722

量化爬虫第一步:手把手教你搞定同花顺问财的hexin-v参数(附JS逆向实战)

本文详细介绍了如何通过JS逆向技术破解同花顺问财数据接口的核心加密参数hexin-v,构建稳定可靠的量化数据采集方案。从抓包分析到Cookie Hook技术应用,再到环境补全与参数生成实现,手把手教你完成量化爬虫的第一步。文章还提供了实战注意事项与优化建议,帮助开发者规避常见问题。

weixin_42620202的博客 302

【OC】UIKit常用组件适配iOS 26

在开始之前,得先说说对于iOS 26的设计理念iOS 26最重要的就是引入了液态玻璃效果,液态玻璃结合了玻璃的光学特性和流动性。这种材料为控制和导航元素形成了一个独特的功能层。它会影响界面的外观、感觉和移动方式,根据各种因素进行调整,以帮助将焦点放在基础内容上所以在使用液态玻璃效果的时候,一定要注意不要让液态玻璃效果影响到用户的可读性,我们只需要将液态玻璃效果控制在重要的部分即可同时,为了适配液态玻璃效果,我们应该尽可能的减少自定义背景,并让系统决定背景外观。

liusir0324的博客 5873

告别安装报错!保姆级教程:用阿狸狗破戒大师V3.2.6搞定Cadence 17.4完整安装与补丁

本文提供Cadence 17.4的完整安装与破解教程,特别针对国内用户常见问题优化。从前期准备、镜像处理到阿狸狗破戒大师V3.2.6的智能破解,再到补丁管理与性能调优,详细指导每一步操作,确保一次性安装成功并提升设计效率。

weixin_30632089的博客 835

动力锂电池-二阶RC模型等效电路-RLS参数辨识-Simulink

1.锂电池二阶RC等效电路模型

QQ1978009424的博客 1万+

适配 iPhone X Push 过程中 TabBar 位置上移

点击上方“iOS开发”,选择“置顶公众号” 关键时刻,第一时间送达! 前言 就在刚刚GitHub有同学给我提了个Issue,说我的框架在iPhone X上跑有bug,Push新页面的时候TabBar会上移。开玩笑吧?我的框架怎么会有bug,这一定是个误会,于是我去iPhone X跑了一下,哎哟嘿,脸好疼 image.p

iOS_开发 1605

在 SAP 中,应收票据的收取、到期承兑、贴现均有标准操作路径与事务码,以下按业务场景给出操作步骤、T-code、会计分录(含附 / 不附追索权)

摘要:本文详细介绍了SAP系统中应收票据的全流程处理,包括收款(F-36)、到期承兑(F-34/F-20)和贴现(F-33)的标准操作。重点说明了不同业务场景下的事务码使用、操作步骤及对应的会计分录,特别区分了附追索权与不附追索权贴现的处理差异。同时提供了票据查询(FBL5N)和清账(F-32)的辅助功能指引,并汇总了各业务场景的核心会计分录,为财务人员提供了一套完整的SAP应收票据操作指南。(149字)

金牌架构师 263

阿里PRM模型:用Transformer实现推荐系统重排序的全局优化

在推荐系统中,排序模型是提升用户体验和商业价值的关键环节。其核心原理是通过对候选物品列表进行全局优化,综合考虑用户偏好、物品间关系及业务目标,生成更优的最终展示顺序。Transformer架构凭借其强大的序列建模和注意力机制,成为解决这一问题的有效技术。它通过捕捉列表中任意物品间的相互影响,实现从“点”到“面”的推荐思维跃迁。在工程实践中,将精排模型的预估分作为特征输入,并引入个性化注意力偏置,是PRM模型的关键设计。该技术能有效提升列表的多样性、新鲜度及商业指标融合度,广泛应用于电商、内容等信息流场景,最

weixin_34375251的博客 384

ArXiv 2026 即插即用 | Transformer篇 | WeightFormer:告别二次复杂度!无注意力的线性时间 Transformer,泛化能力拉满

WeightFormer是一种创新的动态Transformer架构,其核心创新在于通过双动态算子(空间自适应动态卷积和双边激活动态线性)实现输入自适应的特征提取。该模块采用静态-动态权重融合机制和低秩预测技术,在仅增加5%参数量的情况下显著提升模型泛化能力。相比传统Transformer,WeightFormer在ImageNet-1K上提升2.3%精度,小样本任务提升12%,同时保持线性计算复杂度。模块可直接替换标准Transformer块,特别适合轻量级视觉任务,实现了精度与效率的平衡。

主要更新底层视觉(去噪、超分等)相关的科研内容,形式为【论文精读】+【论文复现】 128

Unity零基础到进阶 | Unity 探针系统深度解析:光照探针、反射探针与相关技术

在 Unity 渲染管线中,探针(Probe) 是一类通过预计算或实时采样来捕捉空间光照信息的核心组件。它们弥补了传统静态光照贴图和实时光源各自的局限性,是实现高质量、高性能全局光照效果的关键工具。 本文将系统介绍光照探针(Light Probe)和反射探针(Reflection Probe)的作用与用法,分析二者之间的协同关系,并延伸介绍自适应探针体积(APV)、光照探针代理体(LPPV)、探针体积等进阶技术。

努力前行,总会成为自己心中的那道光 1万+

iOS11 & iPhoneX适配指南

参考资料: App界面适配iOS11(包括iPhoneX的奇葩尺寸) 有关iOS11和iPhoneX的适配问题 适配iOS11&iPhoneX的一些坑 判断iPhoneX swift 判断iPhoneX extension UIDevice { //是否iPhoneX public class func isIphoneX() -> Bool {

samuelandkevin的专栏 1387

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

配置tabBar:设置顶部或底部菜单栏(对若干一级页面的入口连接)

当顶部或者底部需要菜单栏时,我们可以通过设置tabBar快速实现。 属性 类型 必填 默认值 描述 最低版本 color HexColor 是 tab 上的文字默认颜色,仅支持十六进制颜色 selectedColor HexColor 是 tab 上的文字选中时的颜色,仅支持十六进制颜色 backgroundColor HexColor 是 tab 的背景色,仅支持十六进制颜色 borderStyle string 否 black tabbar 上边框的颜色, 仅支持 black / white

chabc1999的博客 1868

深度学习工具包 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")

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

Flutter 滚动距离来设置TabBar的位置,点击TabBar滚动的到指定的位置

文章目录效果git定义属性每个组件设置Key获取控件的距离顶部的位置设置监听设置TabBar 点击getY 效果git 定义属性 ScrollController _controller = new ScrollController(); var globalKeyOne = GlobalKey(); var globalKeyTwo = GlobalKey(); var gl...

yujunlong3919的专栏 5831

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

iPhoneX适配解决iPhoneX跳转页面时tabbar上移问题

iPhoneX马上要发布了,所以iPhoneX的适配也提上了日程,近日发现一个问题是,当跳转页面的时候,只要加上hidesBottomBarWhenPushed = YES 这行代码,当跳转页面的时候,tabbar都会上移一下,返回的时候也是回到原位的。问题虽然不大,但看着难受。所以千方百计的找解决办法。终于,解决办法如下:                第一步:写一个类继承自UITabBar

Zoneday的博客 8561

微信小程序tabbar的定义位置

1、顶部"position": "top", 2、底部"position": "bottom", 不写position的时候默认为底部;

xuantaiyang888的博客 1516

自定义tabbar(适配iPhoneX)

对应GitHubDemo地址 对于iOS系列设备来说.底部的tabbar由于去掉了Home键,底部有一个安全区作为用户的手势交互区(使用一些手势来完成Home键的操作).一些使用UIView去自定义UITabbar的如果想适配iPhoneX的话就需要写1.一个判断设备的宏.2.tabbar高度的宏. 我觉得上面的方法太复杂了(比如又来了个iPhoneXX,或者是iPadXX怎么弄,新增...

MeteoriteMan的博客 9679
上一篇: Vuforia AR学习
下一篇: iOS11 打开系统相册 导航栏透明 且列表的frame也不对
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值