UINavigationController 使用详解

Miniforge3部署教程,完美替代Anaconda3 大背景不介绍了,哎!直接上教程! 阅读详情

UINavigationController是IOS编程中比较常用的一种容器view controller,很多系统的控件(如UIImagePickerViewController)以及很多有名的APP中(如qq,系统相册等)都有用到。说是使用详解,其实我只会介绍几个自认为比较重要或者容易放错的地方进行讲解,下面让我们挨个探探究竟:

  首先上一张图(来自苹果官方文档):

                        UINavigationController view层级

1、navigationItem

  我们都知道navigationItem是UIViewController的一个属性,这个属性是为UINavigationController服务的。文档中是这么解释的“The navigation item used to represent the view controller in a parent’s navigation bar. (read-only)”,即navigation item在navigation Bar代表一个viewController,具体一点儿来说就是每一个加到navigationController的viewController都会有一个对应的navigationItem,该对象由viewController以懒加载的方式创建,稍后我们可以在对象中堆navigationItem进行配置,可以设置leftBarButtonItem, rightBarButtonItem, backBarButtonItem, title以及prompt等属性。前三个每一个都是一个UIBarButtonItem对象,最后两个属性是一个NSString类型描述,注意添加该描述以后NavigationBar的高度会增加30,总的高度会变成74(不管当前方向是Portrait还是Landscape,此模式下navgationbar都使用高度44加上prompt30的方式进行显示)。当然如果觉得只是设置文字的title不够爽,你还可以通过titleview属性指定一个定制的titleview,这样你就可以随心所欲了,当然注意指定的titleview的frame大小,不要显示出界。

  举个简单的例子:

复制代码
// set rightItem
UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithTitle:@"Root" style:UIBarButtonItemStyleBordered target:self action:@selector(popToRootVC)];
childOne.navigationItem.rightBarButtonItem = rightItem;
[rightItem release];
    
// when you design a prompt for navigationbar, the hiehgt of navigationbar will becaome 74, ignore the orientation
childOne.navigationItem.prompt = @"Hello, im the prompt";
复制代码

  这段代码设置了navigationItem的rightBarButtonItem,同时设置了prompt信息。

 

2、titleTextAttributes(ios5.0以后可用)

  这是UINavigationBar的一个属性,通过它你可以设置title部分的字体,这个属性定义如下:


@property(nonatomic,copy) NSDictionary *titleTextAttributes __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_5_0) UI_APPEARANCE_SELECTOR;

  它的dictionary的key定义以及其对应的value类型如下:

//    Keys for Text Attributes Dictionaries
//    NSString *const UITextAttributeFont;                       value: UIFont
//    NSString *const UITextAttributeTextColor;                 value: UIColor
//    NSString *const UITextAttributeTextShadowColor;       value: UIColor
//    NSString *const UITextAttributeTextShadowOffset;      value: NSValue wrapping a UIOffset struct.

  下面看一个简单的例子:

NSDictionary *dict = [NSDictionary dictionaryWithObject:[UIColor yellowColor] forKey:UITextAttributeTextColor];
childOne.navigationController.navigationBar.titleTextAttributes = dict;

  这个例子就是设置title的字体颜色为黄色,怎么样简单吧。

 

3、wantsFullScreenLayout

  viewController的一个属性,这个属性默认值是NO,如果设置为YES的话,如果statusbar,navigationbar, toolbar是半透明的话,viewController的view就会缩放延伸到它们下面,但注意一点儿tabBar不在范围内,即无论该属性是否为YES,view都不会覆盖到tabbar的下方。

 

4、navigationBar中的stack

  这个属性可以算是UINavigationController的灵魂之一,它维护了一个和UINavigationController中viewControllers对应的navigationItem的stack,该stack用于负责navigationbar的刷新。“注意:如果navigationbar中navigationItem的stack和对应的NavigationController中viewController的stack是一一对应的关系,如果两个stack不同步就会抛出异常。

  下面举个简单抛出异常的例子:

SvNavChildViewController *childOne = [[SvNavChildViewController alloc] initWithTitle:@"First" content:@"1"];
[self.navigationController pushViewController:childOne animated:NO];
[childOne release];
    
// raise exception when the stack of navigationbar and navigationController was not correspond
[self.navigationController.navigationBar popNavigationItemAnimated:NO];

  当pushViewcontroller的之后,强制把navigationBar中的navigationItem pop一个出去,程序立马挂起。当然这纯粹只是为了验证问题,我想一般的码农没有人会这么写的。

 

5、navigationBar的刷新

  通过前面介绍的内容,我们知道navigationBar中包含了这几个重要组成部分:leftBarButtonItem, rightBarButtonItem, backBarButtonItem, title。当一个view controller添加到navigationController以后,navigationBar的显示遵循一下几个原则:

  1)、Left side of the navigationBar

  a)如果当前的viewController设置了leftBarButtonItem,则显示当前VC所自带的leftBarButtonItem。

  b)如果当前的viewController没有设置leftBarButtonItem,且当前VC不是rootVC的时候,则显示前一层VC的backBarButtonItem。如果前一层的VC没有显示的指定backBarButtonItem的话,系统将会根据前一层VC的title属性自动生成一个back按钮,并显示出来。

  c)如果当前的viewController没有设置leftBarButtonItem,且当前VC已是rootVC的时候,左边将不显示任何东西。

  此处注意:5.0中新增加了一个属性leftItemsSupplementBackButton,通过指定该属性为YES,可以让leftBarButtonItem和backBarButtonItem同时显示,其中leftBarButtonItem显示在backBarButtonItem的右边。

  2)、title部分

  a)如果当前VC通过 .navigationItem.titleView指定了自定义的titleView,系统将会显示指定的titleView,此处要注意自定义titleView的高度不要超过navigationBar的高度,否则会显示出界。

  b)如果当前VC没有指定titleView,系统则会根据当前VC的title或者当前VC的navigationItem.title的内容创建一个UILabel并显示,其中如果指定了navigationItem.title的话,则优先显示navigationItem.title的内容。

  3)、Right side of the navigationBar

  a)如果当前VC指定了rightBarButtonItem的话,则显示指定的内容。

  b)如果当前VC没有指定rightBarButtonItem的话,则不显示任何东西。

 

6、Toolbar

  navigationController自带了一个工具栏,通过设置 self.navigationController.toolbarHidden = NO来显示工具栏,工具栏中的内容可以通过viewController的toolbarItems来设置,显示的顺序和设置的NSArray中存放的顺序一致,其中每一个数据都一个UIBarButtonItem对象,可以使用系统提供的很多常用风格的对象,也可以根据需求进行自定义。

  设置Toolbar内容的例子:

复制代码
// test ToolBar
UIBarButtonItem *one = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:nil action:nil];
UIBarButtonItem *two = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemBookmarks target:nil action:nil];
UIBarButtonItem *three = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:nil action:nil];
UIBarButtonItem *four = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemEdit target:nil action:nil];
UIBarButtonItem *flexItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
[childOne setToolbarItems:[NSArray arrayWithObjects:flexItem, one, flexItem, two, flexItem, three, flexItem, four, flexItem, nil]];
[one release];
[two release];
[three release];
[four release];
[flexItem release];
    
childOne.navigationController.toolbarHidden = NO;
复制代码

 

7、UINavigationControllerDelegate

  这个代理真的很简单,就是当一个viewController要显示的时候通知一下外面,给你一个机会进行设置,包含如下两个函数:

// Called when the navigation controller shows a new top view controller via a push, pop or setting of the view controller stack.
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated;
- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated;

  当你需要对某些将要显示的viewController进行修改的话,可实现该代理。

 

8、UINavigationController的viewControllers属性

  通过该属性我们可以实现一次性替换整个navigationController的层次, 这个过程如果通过setViewControllers:animated:来设置,并指定动画为YES的画,动画将会从当前的navigationController所显示的vc跳转到所设置的目标viewController的最顶层的那个VC,而中间其他的VC将会被直接从VC层级中移除和添加进来(没有动画)。

 

9、topViewController Vs visibleViewController

  topViewController代表当前navigation栈中最上层的VC,而visibleViewController代表当前可见的VC,它可能是topViewController,也可能是当前topViewController present出来的VC。因此UINavigationController的这两个属性通常情况下是一样,但也有可能不同。

  ------------------(完)

锂电池充放电管理-单片机通用模版 - **①两节锂电池通过电阻分压检测ADC,再根据电压划分电量等级;** - **②充电使用的是锂电池充电IC方案,可通过硬件电阻参数调节充电电流,并可以通过STAT引脚检测充电和满电状态(充电注意会抬高电压);** - **③放电根据ADC_BAT检测电池电量进行等级划分(注意大负载电压骤降瞬间);** - **④充放电过程注意在电量划分等级临界值来回抖动现象;** 阅读详情

相关推荐

从零构建AI Agent集群:Docker Compose与Nginx部署实战

在AI应用开发领域,微服务架构和容器化部署已成为提升开发效率和系统可维护性的关键技术。Docker Compose作为容器编排工具,能够将多个独立服务(如Node.js、Python应用)及其依赖(数据库、缓存)封装在隔离环境中,并通过统一配置文件定义服务间的网络与依赖关系,实现一键启停。Nginx作为反向代理,则提供了统一的网络入口、请求路由和负载均衡能力,是构建高可用Web应用的基石。这种组合技术方案的价值在于,它能将复杂的AI系统(如工作流引擎、对话Agent、技能库)的部署运维复杂度大幅降低,使得开

weixin_27028523的博客 638

iOS9程序设计(顶级iOS开发视频课程-Objective-C版)

iOS9程序设计(顶级iOS开发视频课程-Objective-C版)本课程主要内容包括:iOS9的基础知识常用控件屏幕适配多窗口导航表视图GPS地图网络数据存储、音频视频本地化等内容,并提供了大量的源代码供学员练习。

以太网传输硬件设计大全

1.网线的介绍RJ45由插头和插做组成,也就是我们常说的网口和网线。RJ45 网线插头又称水晶头,共有八芯做成。RJ45网络传输线分为直通线、交叉线和全反线。直通线用于异种网络设备之间的互连,例如,计算机与交换机。交叉线用于同种网络设备之间的互连,例如,计算机与计算机。全反线用于超级终端与网络设备的控制物理接口之间的连接。下面将介绍一下各线的作用和区别。1.直通线:又叫正线或标准线,两端采用568B做线标准,注意两端都是同样的线序且一一对应。直通线是应用最广泛,现在最常用的线。

weixin_45365488的博客 6749

iOS objective-c实现底部导航栏

一个有5个ViewController ViewController.m文件 // // ViewController.m // haha // // Created by 温国强 on 2022/1/9. // #import "ViewController.h" #import "ViewController2.h" #import "ViewController3.h" #import "ViewController4.h" #import "ViewController5.h" #i

WenZhengshi的博客 2068

LTspice第三方SPICE模型集成全流程指南

SPICE模型是电子电路仿真的核心基础,它通过数学方程描述半导体器件的非线性、温度依赖与寄生特性,决定仿真结果是否具备工程可信度。其技术价值在于 bridging 理论参数与实测行为,显著提升电源、电机驱动及逻辑电路设计的一次成功率。典型应用场景包括IGBT开关损耗分析、LDO瞬态响应验证、CMOS逻辑门传播延迟评估等。而LTspice作为轻量级工业级工具,依赖用户主动集成原厂提供的.subckt或.model文本模型——这正是‘LTspice导入SPICE模型’和‘74HC14 SPICE模型’等高频搜索

weixin_33868027的博客 299

别再死记硬背了!用Python可视化带你直观理解柯西收敛定理(附NumPy代码)

本文通过Python可视化技术,结合NumPy和Matplotlib,直观展示柯西收敛定理的动态过程。文章提供了完整的代码实现,帮助读者从抽象数学定义过渡到具象理解,特别适合数学学习者和Python开发者。通过热力图和交互式参数探索,读者可以清晰观察数列收敛特性,提升数学分析的学习效率。

weixin_28465009的博客 185

超级牛掰的底部导航栏

  一、导依赖 compile 'com.hjm:BottomTabBar:1.1.1'  二、Xml布局中 <com.hjm.bottomtabbar.BottomTabBar android:id="@+id/bottom_tab_bar" android:layout_width="match_parent" android:layout_height="match_par...

Natty的博客 371

川崎机器人总线通信_三菱PLC和发那科机器人进行CCLINK总线通信

三菱CCLINK主站模块采用QJ61BT11N,该模块用在Q系列PLC上,如果是5U或3UPLC,可用FX5-CNV-BUS加FX3U-16CCL-M或FX5-CCL-M模块。本教程以Q系列为例CCLINK接线方法如下模块拨码含义如下接线和拨码设置好后,接着在编程软件上设置CCLINK通信参数打开编程软件,在工程导航栏打开参数——网络参数,选中CCLINK打开。打开如下画面起始IO为模块本体占用I...

weixin_42300398的博客 7546

UINavigationController详解

UINavigationController使用详解   有一阵子没有写随笔,感觉有点儿手生。一个多月以后终于又一次坐下来静下心写随笔,记录自己的学习笔记,也希望能够帮到大家。   废话少说回到正题,UINavigationController是IOS编程中比较常用的一种容器view controller,很多系统的控件(如UIImagePickerViewController)以及很多有名的...

weixin_33739646的博客 310

CAD文件转换避坑指南:Inventor导出STP时这些设置千万别忽略

本文深入解析了使用Autodesk Inventor导出STP文件时的关键设置与避坑指南。重点探讨了应用协议选择、样条曲线拟合精度对几何保真度的影响,以及装配体结构和元数据的保全策略,旨在帮助用户实现高质量、零误差的CAD数据交付,避免下游软件打开时出现特征丢失或曲面破碎等问题。

weixin_29214559的博客 517

CVE-2017-7921漏洞深度解析:海康设备明文密码泄露原理与七层防御

网络摄像头安全本质上是嵌入式Web服务安全,其核心在于身份认证机制是否健全。CVE-2017-7921并非传统远程执行漏洞,而是因信任错位导致的未授权API暴露——`/Security/users/1`接口绕过Session校验,直接返回admin明文密码。该问题根植于安防设备早期‘物理隔离+前端可控’的设计假设,在P2P、云平台等新场景下全面失效。技术价值在于揭示了轻量级HTTP服务中路径级访问控制缺失的普遍风险;典型应用场景包括ONVIF协议接管、Telnet后门登录及NVR侧横向移动。本文基于DS-2

weixin_33324197的博客 397

swift 设置navigationBar titleTextAttributes

swift 设置navigationBar titleTextAttributes  //设置navigationBar的背景图片 let backgroundImage = UIImage(named: "navigation_bg") self.navigationBar.setBackgroundImage(backgroundImage, forBarM

wenzfcsdn的专栏 7937

AI测试入门:如何测试AI对话模型/智能体?「详细介绍」

作为测试人员,我们需要掌握特定的技能和方法来有效地测试这些复杂的AI对话模型和智能体。传统的软件测试方法在这里可能不再完全适用,我们需要开发新的测试策略和技术来应对AI系统的独特特性。在这篇文章中,我们将深入探讨如何测试AI对话模型和智能体。

blues_C的博客 6855

UINavigationController使用详解

有一阵子没有写随笔,感觉有点儿手生。一个多月以后终于又一次坐下来静下心写随笔,记录自己的学习笔记,也希望能够帮到大家。   废话少说回到正题,UINavigationController是IOS编程中比较常用的一种容器view controller,很多系统的控件(如UIImagePickerViewController)以及很多有名的APP中(如qq,系统相册等)都有用到。说是使用详解,其实我只

174

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

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

IOS 关于UINavigationController的使用

前言 最近理了一下UINavigationBar,发现UINavigationController使用的时候有很多问题。所以结合自己使用的理解,总结一下。 UINavigationController 用来管理 UIViewController(视图控制器),它以栈的形式管理,UIViewController个数理论上不受限制(当然内存还是要考虑的),push和pop方法来弹入弹出UIViewCo...

sky_long_fly的专栏 4268

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

UINavigationController 详解

一UINavigationController的结构组成 二创建 三对导航条的设置 四界面之间的交互采用的是出栈入栈的形式 五其他细节 六含有导航栏的视图里tableView的坐标问题 七滑动返回 自定义导航栏leftBarButtonItems导致滑动返回失效

任意门 1199

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

UINavigationController总结

UINavigationController 相关的内容 参考链接 写的挺好的 清晰 参考链接也都列出来了 参考链接 UINavigationController继承自UIViewController 属于容器类的VC,管理VC的方式遵从栈的管理原则 包括几个部分 Navigation toolbar Custom content Navigation bar Navigation view Item部分 nav上的标题,按钮返回按钮 right按钮这些东西 通过self.navitem修改 每个被p

github_38399864的博客 415

UINavigationController

UINavigationController A container view controller that defines a stack-based scheme for navigating hierarchical content. 一个定义基于堆栈结构的导航分层内容的容器视图控制器。 声明 @interface UINavigationController : UIViewCont...

Stay Hungry, Stay Foolish. 535

在modal view中使用UINavigationController

通常来说,我们在实现ios视图跳转

OceanDev 1572
上一篇: removeFromSuperview关键的几个点
下一篇: UITabBarController使用详解
一秀
博客等级 码龄14年 1粉丝 11原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值