iOS隐藏导航栏下面的横线

适配IOS 15 系统导航栏状态栏白条问题 手机更新IOS 15之后发现我们的APP的头部导航栏忽然多出来一行白条如下图所示。 这是什么所导致的呢? scrollEdgeAppearance 属性 iOS15 强制适用于所有导航器 导航控制器包含导航栏和滚动视图,滚动视图的部分内容将显示在导航栏下方。当滚动内容的边缘到达该栏,UIKit将在此属性中应用外观设置。此属性的值为nil的时候,UIKit将使用standardAppearance属性中的设置,并修改为使用透明背景。当没有导航控制器管理导航栏时,UIKit将忽略此属性,并使用导航栏的标准 阅读详情

方法一:

[self.navigationController.navigationBar setBackgroundImage:[[UIImage alloc]init]forBarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault];
    [self.navigationController.navigationBar setShadowImage:[UIImage new]];

方法二:

1 声明UIImageView变量,存储底部横线
@implementation MyViewController 
{
    UIImageView *navBarHairlineImageView;
}

2 在viewDidLoad中加入:
navBarHairlineImageView = [self findHairlineImageViewUnder:navigationBar];

3 实现找出底部横线的函数
- (UIImageView *)findHairlineImageViewUnder:(UIView *)view {
    if ([view isKindOfClass:UIImageView.class] && view.bounds.size.height <= 1.0) {
            return (UIImageView *)view;
    }
    for (UIView *subview in view.subviews) {
        UIImageView *imageView = [self findHairlineImageViewUnder:subview];
        if (imageView) {
            return imageView;
        }
    }
    return nil;


4 最后在viewWillAppear,viewWillDisappear中处理
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    navBarHairlineImageView.hidden = YES;
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    navBarHairlineImageView.hidden = NO;
}
IOS 去掉导航栏(UINavigationBar)下方的横线 下图是要最终实现的效果: 但是,开始时会出现下图中箭头指向的横线效果: 这是导航栏的问题,将下边的代码放在  viewWillAppear  方法中就可以实现效果: - (void)viewWillAppear:(BOOL)animated{          // Called when the view is about to made visible. 阅读详情

相关推荐

仿ios底部菜单栏

仿ios底部菜单栏,配置的styles,drawale比较多,整个一套,复制黏贴

iOS隐藏导航条、tabbar 1px的底部横线

原文链接:http://blog.it985.com/9808.html 默认情况下会有这条线 第一种方法: 1 2 3 4 5 6 UINavigationBar *navigationBar = self.navigationController.navigationBar; /

qimuya的专栏 3687

很漂亮的仿苹果的导航条

一个很漂亮的仿苹果的导航条,效果仿的很逼真的说。。。

仿ios菜单导航栏

模仿ios 菜单导航栏,点击菜单跳转 函数 /** * @Description: 浮动菜单 * @params: menus: Array 菜单列表 [ {name: '', href: "", icon: "" }] * @return: { } * <div class="float-ball-box"> <div class="float-ball-box-layer">

Mr_Chao的博客 863

ios-仿Twitter资料导航栏.zip

仿Twitter资料导航栏

高仿苹果主页导航栏(最新版),支持移动端

仿苹果官方网站导航栏,兼容IE,谷歌,火狐等主流浏览器

iOS之旅--隐藏(去除)导航栏底部横线

iOS开发大部分情况下会使用到导航栏,由于我司的app导航栏需要与下面紧挨着的窗口颜色一致,导航栏底部的横线就会影响这个美观,LZ使用了以下方法。觉得不错,分享来给小伙伴们。 1)声明UIImageView变量,存储底部横线 @interface MyViewController { UIImageView *navBarHairlineImageView; }123 2

1238

ios-仿知乎导航栏渐变.zip

仿知乎导航栏渐变

iOS开发中如何隐藏导航栏下的线条

我们有时候需要隐藏掉导航栏下面的线那么我们怎么操作呢? 首先 我们定义个属性 @property (nonatomic, strong)UIImageView *contentLineImageView; 然后写一个方法: - (UIImageView *)findHairlineImageViewUnder:(UIView *)view {     if (

bestoneToo的博客 1261

iOS如何去掉导航栏(UINavigationBar)下方的横线

本篇文章主要介绍了iOS如何去掉导航栏(UINavigationBar)下方的横线,非常具有实用价值,需要的朋友可以参考下

(三)从零开始学习模糊控制——模糊决策

模糊控制之基础——模糊数学 (一)模糊数学——基本概念 (二)模糊数学——模糊关系 (三)模糊数学——模糊决策 文章目录模糊控制之基础——模糊数学前言一、模糊决策法1.最大值原理2.模糊排序2.模糊寻优总结 前言   模糊决策是指在模糊环境下进行决策的数学理论和方法。这类问题─般具有大系统特征,系统之间的关系十分复杂,存在不能准确赋值的变量,这些变量属于模糊因素,涉及到一定的主观因素,使得子系统之间、变量之间的关系不清晰,从而必须借助排序、模糊评判等方法来进行处理。 一、模糊决策

qq_43667552的博客 4750

iOS导航条底部 与self.view 的分界线怎么隐藏

设置背景图片 self.navigationController.navigationBar setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault]; 加上下面代码可以取消导航下边的线,此方法也可以使用于tabbar self.navigationController.navigationBar

darongzi1314的专栏 1769

Vivado图形化界面烧写MCS文件到SPI FLASH全流程(附常见报错解决方案)

本文详细介绍了使用Vivado图形化界面将MCS文件烧录至SPI FLASH的完整操作流程。内容涵盖从环境准备、MCS文件生成到硬件连接与烧写的每一步,并针对SPI总线宽度报错、FLASH型号识别失败等常见问题提供了深度解决方案,帮助用户高效完成FPGA配置,摆脱对TCL命令行的依赖。

s8t9u0v1w的博客 536

隐藏导航栏底部横线 隐藏navigationBar底部的线

iOS开发大部分情况下会使用到导航栏,由于我司的app导航栏需要与下面紧挨着的窗口颜色一致,导航栏底部的横线就会影响这个美观,LZ使用了以下方法。觉得不错,分享来给小伙伴们。1)声明UIImageView变量,存储底部横线@interface MyViewController { UIImageView *navBarHairlineImageView; }2)在viewDidLoad中加入

Jesse0308的博客 1794

COMSOL报错调试总结(不定期更新)

COMSOL报错调试总结1. 可定位错误1.1 除零错误1.2 未定义变量值1.3 边界条件/材料属性等缺失2. 难定位错误2.1. 装配期间内存不足 官方给的案例总是非常完美,运行流畅,结果完美。但是自己做模型时候就总是报错,而且不像自己coding的程序那样可以明确定位哪里出了bug。这里把我碰到的一些报错问题以及调试方法记录下来~ 部分来源于以下参考来源: http://wap.sciencenet.cn/blog-1467490-1118453.html?mobile=1 1. 可定位错误 以下错误

jessica0307的博客 8万+

YF-S401水流量传感器在STM32上的精准计量实现

本文详细介绍了YF-S401水流量传感器与STM32微控制器的集成应用,实现精准水流计量。通过外部中断和外部时钟两种脉冲计数方案,结合硬件配置、软件滤波和校准技巧,确保高精度流量测量。适用于智能家居和工业自动化中的水控系统,提升系统稳定性和测量准确性。

rainy的博客 896

IOS去掉导航栏(UINavigationBar)下方的横线

第一种方法:这是唯一一个隐藏这条线的官方用法,但是有一个缺陷-删除了translucency(半透明) - (void)viewWillAppear:(BOOL)animated {     [super viewWillAppear:animated];     //去除导航栏下方的横线     UINavigationBar *navigationBa

qq_17173419的专栏 723

UE5深度图与Mask图渲染实战:从基础到高级应用

本文详细解析了在UE5中渲染深度图与Mask图的完整实战流程。从启用电影渲染队列、配置自定义深度模板通道等前期准备,到构建即用型深度图材质网络与精准物体Mask生成,并深入探讨了二者结合在NPR风格化、程序化雾气及AI工作流(如ComfyUI)中的高级应用,为影视、游戏后期与AI创作提供了高效的解决方案。

weixin_29001419的博客 349

导航栏背景色修改&导航栏下面的横线消除

通常用的是此方法,来修改导航条的颜色 self.navigationController.navigationBar.barTintColor = [Common hexStringToColor:@"47a8ef"];那么,问题是,实际上系统导航栏其实是半透明状态的,颜色会有色差! 颜色会变的比平常的淡!! 我们只需要改变导航条的半透明状态 — translucent属性 self.na

iOSTianNan的博客 8055

Coze+剪映小助手实战:5分钟搞定视频草稿创建工作流(附常见错误排查)

本文详细介绍了如何利用Coze平台与剪映小助手,通过create_draft接口快速搭建自动化视频草稿创建工作流。文章从核心价值、零基础搭建步骤、运行验证到深度错误排查,手把手教你5分钟内实现视频项目参数预设的标准化与自动化,显著提升短视频创作与团队协作效率。

oil88的博客 549

位置点位到达判断FC(Easy+Codesys+博途平台)

IN rActPositon REAL 轴当前实际位置 1IN arAbsPosition REAL[10] 各工作点位坐标 2IN rDeadZone REAL 位置达到判断域值 范围 3OUT abInAbsPos BOOL[10] 到达各绝对定位点位标志 位置到达输出 4VAR i INT 循环计数 5VAR rErr REAL 位置偏差 6。

RXXW_Dor的博客 536

iOS 去除导航栏下面的黑线

在项目有时候需要去除掉导航栏下面的黑线,现在附上代码,供大家参考 @property (nonatomic, weak) UIImageView * lineView; //1.视图加载完成获取到导航栏最下面的黑线 - (void)viewDidLoad { [super viewDidLoad]; //2.获取导航栏下面的黑线 self.lineVi

YJLiOS的博客 2283

锂电池SOC估计 | 基于LSTM长短期记忆神经网络的锂电池SOC估计(附matlab完整代码)

锂电池SOC估计 | 基于LSTM长短期记忆神经网络的锂电池SOC估计(附matlab完整代码)

前程算法屋的博客 1023

处理隐藏导航栏底部的横线首先要明白苹果导航栏底部横线用的是UIImageView

1、声明UIImageView变量,表示底部横线 @property (weak, nonatomic) UIImageView *navBarLine ; 2、从那导航栏中找到地步横线 self.navBarLine = [self foundNavBarLine:self.navigationController.navigationBar] ;

u010226872的博客 924

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

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

深度学习工具包 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多个区里面的控件寻找
下一篇: 友盟分享gif图片,只支持微信
flyweak
博客等级 码龄11年 1粉丝 22原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值