iOS AutoLayout: 关联 Xib 和 UIViewController

32、iOS视图控制器:视图获取、故事板与视图调整全解析 本文深入解析了iOS开发中视图控制器获取视图的多种方式,包括代码创建、从nib文件加载以及使用故事板等。同时详细介绍了视图调整相关的核心知识,如自动布局、安全区域的使用、状态栏的控制等内容,并通过实际案例展示了如何综合运用这些技术来开发高质量的iOS应用。 阅读详情

今天主要跟大家分享两个内容
* UIViewController 如何作为 Xib 的 File’s Owner
* Xib 中的组件如何和 UIViewController 连线

创建工程 MZXibAndVC

简单的创建一个 Single View 的 iOS 工程即可.

创建 xib 文件 View.xib

新建文件/iOS/UserInterface View/Empty

编辑 View.xib

不使用 Size Classes
增加一些用来测试的组件, 效果如下.
图1

和 UIVIewController 关联

第一步, 选择 View.xib, 并选择 File’s Owner 选项
在 Custom Classes 中填写需要关联的 ViewController.

图2

第二步, 关联 View

按住 control, 从 File’s Owner 拖线到 View, 如图

图3

在出现的提示框中, 选择 View, 如图, 松手即可完成绑定.

图4

完成之后, 你可以看到, 如图所示的效果.

图5
图6

第三步, 展示关联的视图.

在 ViewController 的 viewDidload 方法中

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    UIView *v = [[UIViewController alloc] initWithNibName:@"View" bundle:nil].view;
    v.frame = self.view.bounds;

    [self.view addSubview:v];
}

编译运行项目, 你会看到效果.

这个时候, 你已经成功关联 xib 并可以展示视图了.

接下来, 我们希望在 ViewController 中改变 xib 中 label 的 text.

很简单, 直接托线到 ViewController 中即可.

图7

完成连线, 再次编译运行.

运行报错了:
图8

发生这种错误的原因是因为, 连线的组件无法关联或是找不到 owner.

解决这个问题很简单.

修改一下 ViewController 中的 viewDidload 实现

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    // 加载方式错误
#if 0
    UIView *v = [[UIViewController alloc] initWithNibName:@"View" bundle:nil].view;
    v.frame = self.view.bounds;

    [self.view addSubview:v];
#endif


    UIView *v = [[[NSBundle mainBundle] loadNibNamed:@"View" owner:self options:nil] lastObject];

    v.frame = self.view.bounds;

    [self.view addSubview:v];
}

再次运行, 还是报错:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Can't add self as subview'

错误很明显, 自己添加自己了.

换句话说, v 和 self.view 是同一个对象.

解决方案:

去掉

[self.view addSubview:v];

可以通过 log 来观察两个视图之间的关系:

@interface ViewController ()

@property (strong, nonatomic) IBOutlet UILabel *mylab;

@property (strong, nonatomic) IBOutlet UIImageView *myphoto;

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    // 加载方式错误
#if 0
    UIView *v = [[UIViewController alloc] initWithNibName:@"View" bundle:nil].view;
    v.frame = self.view.bounds;

    [self.view addSubview:v];
#endif

    UIView *v = [[[NSBundle mainBundle] loadNibNamed:@"View" owner:self options:nil] lastObject];

    v.frame = self.view.bounds;

    NSLog(@"v = %@", v);
    NSLog(@"self.view = %@", self.view);

    NSLog(@"v == self.view? %i", (v == self.view));

    self.mylab.text = @"Comeon";

    // 自己不可以 add 自己
    //[self.view addSubview:v];
}

另外, 还有一种从 xib 加载ViewController 的方式:

-(instancetype)initWithNibName:(NSString )nibNameOrNil bundle:(NSBundle )nibBundleOrNil

可以移步 iOS AutoLayout: 从 XIB 中加载UIViewController.

下篇具体给大家探讨 UIView 关联 xib.

微信小程序转化数据API自归因实战:PHP实现与2025升级要点解析 本文详细解析了2025年微信小程序转化数据API自归因的升级要点与PHP实战实现。核心变化包括接口地址更新、固定access_token的获取方式,以及新增timestamp与nonce等安全参数。文章提供了完整的PHP代码示例,帮助开发者高效完成数据上报,优化腾讯广告投放效果。 阅读详情

相关推荐

BQ25713寄存器配置全解析:从基础原理到笔记本充电实战

在电源管理系统中,寄存器配置是实现精细化控制的核心技术。其原理是通过I2C等总线向芯片内部特定地址写入二进制代码,直接设定其工作参数与行为逻辑,从而实现对电压、电流、功率及保护阈值的底层控制。这项技术的价值在于,它能将通用电源管理芯片灵活适配于千差万别的具体应用,是提升系统性能、可靠性与能效的关键。在便携设备、嵌入式系统等场景中,精准的寄存器配置决定了充电效率、动态响应和故障保护能力。本文聚焦于**BQ25713**这款经典充电管理芯片,深入剖析其**ChargeOption**、**ProchotOpti

weixin_42713608的博客 286

UIView与自建Xib关联

因为UIView创建的时候默认是不能同时创建xib的,但是想用xib搭建界面更方便。 关联步骤: 1.在xcode想创建xib的地方command+n,选择View 名字尽量和想要关联的UIView名称保持一致。 2.在File's Owner中的第三项Class中输入UIView的名称 3.选中xib中自动创建的view,执行与第二步相同的操作,Class中填入UIView...

miaocuilin的专栏 870

银河麒麟桌面操作系统V10(SP1)ssh服务安装与配置

在国产化的大背景下,各种国产操作系统逐步进入运维人员的视野,ssh作为linux远程连接工具,是运维人员必需的工具之一。本文主要介绍在银河麒麟桌面操作系统V10(SP1)上安装和配置ssh服务。

zhengshaolin128的博客 7813

Xcode5 创建模板和UIView 关联XIB

来源:http://www.cnblogs.com/china-ldw/p/3533896.html 在做ios应用开发的过程,难免遇到要创建 子view 和 自定义view的时候,归根到底,我们需要得到一个UIView; 要得到这个UIView,大致有三种方法: 1,创建一个UIViewController,带上一个XIB,得到的UIView为 UIViewController.view;...

weixin_30246221的博客 212

SAP成本中心费用分割(KSS2)实战:从原理到月末调整全解析

本文详细解析了SAP成本中心费用分割(KSS2)的核心逻辑与实战操作,从成本要素分组配置到月末调整全流程。通过KSS2将初级成本要素按作业类型重新分类为次级成本要素,确保成本结算准确。文章还提供了常见错误处理方法和典型业务场景实战,帮助用户高效完成SAP成本结算。

weixin_29279101的博客 1267

适配adv7280m相机到rk3588的安卓平台

Kernel-5.10/arch/arm64/configs/firefly_defconfig里面增加配置CONFIG_VIDEO_ADV7180=y。出现一次开不了机器的情况,接调试口发现,在set_fmt里面用s_ctrl对mipi的频率进行设置会出现异常。设备树修改kernel-5.10/arch/arm64/boot/dts/rockchip/13.dts。把MEDIA_ENT_F_ATV_DECODER改回MEDIA_ENT_F_CAM_SENSOR。第二次编译,仅仅刷新boot.img。

chenyq14的专栏 2449

ios使用xib自定义view

2019独角兽企业重金招聘Python工程师标准>>> ...

weixin_34409741的博客 182

无感无刷电机三段式启动避坑指南:从预定位到闭环切换的STM32代码实现

本文深入解析无感无刷电机的三段式启动流程,涵盖预定位、启动加速与闭环切换三大阶段。重点对比了恒频升压、恒压升频与升频升压三种核心启动策略的优劣,并提供了基于STM32的详细状态机代码实现与关键参数调试指南,帮助工程师有效规避启动失步、线圈过热等常见问题,实现稳定可靠的无感驱动。

herb5的博客 535

IOS中 xib自定义View在storyboard中的使用

最近遇到一个这样的问题,在应用当中有多个ViewController中包含相同布局的SubView。于是就想把这样的View 提取出来做一个自定义的View,这样就可以避免在storyboard中反复绘制相同的东西,代码上也可以降低重复。 摸索了之后总结出下面的步骤: 1,创建UIView 的SubClass 命名为MyView 2, new一个名为MyView的

一枚道人的IOS专栏 6699

MATLAB机械臂建模实战:标准D-H法与改进D-H法到底选哪个?(附代码对比)

本文深入解析MATLAB中机械臂建模的标准D-H法与改进D-H法的本质区别,提供详细的代码对比和可视化结果。通过实际案例,帮助读者根据应用场景选择合适方法,并避免常见建模陷阱。特别关注Link函数和SerialLink工具的使用技巧,提升机械臂建模效率。

grape的博客 1121

2025年上半年第1批信息系统项目管理师论文真题解析与范文

文章首先分析了项目经理在交付绩效域中应关注的重点领域,然后按照项目管理五大过程组顺序,阐述了各过程组中与交付绩效域协同的绩效域及协调目标,最后制定了各过程组中交付绩效域的测量指标。本项目的实践表明,系统化的交付绩效管理不仅能保证项目成功,还能创造超出预期的业务价值。需要结合具体项目案例,按照五大过程组(启动、规划、执行、监控、收尾)顺序,分析各过程组中与交付绩效域协同的其他绩效域及其协调目标。价值交付连续性:建立敏捷交付机制,将项目分解为12个迭代周期,每周期交付可验证成果,确保价值持续流动。

Programming Talk 823

iOS UIViewController 和 xib 绑定 详解

1> 创建 UIViewController,此处不选择 Alse create XIB file 2> 创建 xib 文件 3> 在 xib 中,点击 Placeholder -> File’s Owner 在右边 Show the Identity inspector ,在 Class 中设置 xib 需要绑定 UIViewController

chenshun123的博客 1万+

AI 智能体(Agent)应用开发工程师 · 进阶面试 (五)

在有多位 Agent 共同参与决策时(如评审委员会、代码审查小组),它们可能提出截然相反的建议。共识机制就是用来在这种冲突中得出唯一行动方案的规则。常用机制:多数投票:每个 Agent 一票,根据投票结果决定。实现简单,但忽略了专业度差异。加权投票:根据 Agent 的角色重要性或历史表现赋予不同权重,例如首席架构师 Agent 的票权重是普通开发者 Agent 的 2 倍。管理者仲裁:由一个权限更高的 Manager Agent 听取各方理由后做出最终裁决。这类似于层级制组织决策。辩论收敛。

篮球界最会写bug的人;程序猿中打球最菜的人。 397

iOS AutoLayout: 关联 Xib 和 UIView

在博客 iOS AutoLayout: 关联 Xib 和 UIViewController 中介绍了 UIViewController 如何关联 xib 文件, 并给组件连线和一些问题.今天继续 Autolayout 的话题. 新建一个 Single View 的 iOS 项目 新建一个 Empty 的 Userinterface View, 取名为 View.xib 新建一

CodingMan 2815

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

iOS AutoLayout: 从 XIB 中加载 UIViewController

在博客 iOS AutoLayout: 关联 Xib 和 UIViewController 讨论了 UIViewController 如何和一个 xib 关联并且展现出来.在那篇博客中, 最后说到使用下面这种方式可以加载 ViewController -(instancetype)initWithNibName:(NSString )nibNameOrNil bundle:(NSBundle

CodingMan 2242

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

使用Xib要注意的一些问题

1、运行程序后,模拟器上不是按Xib上的UI显示的 今天开始使用Xib,奇怪地发现在Xib上布好的UI局,运行起来在模拟器上不是按Xib上的UI显示的,有些控件被另一些覆盖了。 解决方案是:第一步:选中目标 ".xib"文件。选取右边最上面那排的第一个像A4纸一样的图标,然后在下面找到 "Use Autolayout",将它前面的"钩"去掉。如图所示: 第二步:选中目标 ".xib"文件。选

u010607889的专栏 1276

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

浅析 - Storyboard / Xib

大家都知道纯代码写应用的成本是很高的,特别是涉及到UI界面的实现,相当耗费时间。之前自己写应用时有了解过Storyboard,也简单使用过,但随着最近深入了解它之后,发现自己低估了它的作用和影响力,因此在这里总结下最近段时间学习到的内容,希望对Storyboard初学者有所帮助。Interface Builder的界面布局如下图:   (图片来自Apple官网) 1.基础概念 在学习St

gongyuhonglou的博客 392

正确的加载xib文件的View或者ViewController

可能很多人都非常熟悉了,在故事版中加载一个ViewController。  ViewC *viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"myController"]; [self.navigationController pushViewController:viewControlle

u012986410的博客 2万+

IOS 添加xib自定义view

突然发现用之前的方法添加xib自定义的view,显示上有问题,如下图,添加的view宽度上存在问题。 1、这是创建的xib自定义的view 2、关联脚本 3、在UIViewController里加载nib,添加view - (void)viewDidLoad { [super viewDidLoad]; // Do any addit

飞跃 Ni Wo Ta 3104

用AutoLayout对UIScrollView进行布局做的引导页

之前项目中全部用代码写的,没有对iPhone6以及iPhone6 plus进行适配。感觉适配是迟早要做的工作,所以有时间的话还是要学习一下AutoLayout。这两天抽时间对app的引导页进行了适配。引导页是用UIScrollView和UIPageControl实现的简单的一个引导页。都说ScrollView的适配是个比较蛋疼的事情,因为UIScrollView的contentSize由它的子视图

Code_Ninja 1239

iOS中 xib自定义View在storyboard中的使用

1,创建UIView 的SubClass 命名为MyView   2, new一个名为MyView的xib p1 3,配置xib的属性 p2 4,为View 添加背景色,添加一个按钮并定制按钮约束,这里我添加的约束为垂直居中,Button与View等宽,Button左边起点位置为0。 p3 5,设置xib中的File’s owner = MyView, 拖拽view 到关联的代码中...

weixin_34310127的博客 210

AutoLayout的使用(ios程序员必备杀手锏)

网易公开课ios开发:http://v.163.com/movie/2014/1/B/P/M9H7S9F1H_M9H80K2BP.html demo下载:https://github.com/MartinLi841538513/AutoLayoutDemo(demo跟下面的解释有些许不一样,但是不妨碍学习) demo2下载:https://github.com/MartinLi8415385...

weixin_30375247的博客 96

swift UIViewController 通过stroyboard添加UIScrollview(如何在 UIScrollView的xib上添加子控件并添加)

每次要使用的时候,有时候选择使用tableview来解决这个问题 所以导致uiscrollview很少使用,其实正确使用uiscrollview也是很好 每次用的时候,都找过不止三次的通过storyboard来添加uiscrollview,但是每次还是重新来,也发表过,但是,今天还是来重写一次,希望这篇是最后一篇 感悟:知识收藏起来,不仅仅是自己可能会忘记,而且对别人一定贡献也没有 xib或者storyboard上添加scrollview,为什么会报那么多的错 因为 UIScrollView 想要.

三线程序员的博客 752

iOS 开发可视化编程之Xib 简述

iOS应用是非常注重用户体验的,在某些方面上应用的成功与否于UI界面是否漂亮,以及应用交互设计上有着非常重要的关系 随着iOS开发发展至今,在UI制作上大概分为三个流派: 1.使用代码手写UI和布局 2.使用Xib文件来组织UI 3.使用StoryBoard故事板 关于三者的优缺点以及应用的场景请移步代码手写UI,xib和StoryBoard间的博弈,以及Interface Builder的一...

weixin_33774308的博客 130

探究 UIViewController 生命周期

由于种种原因,掘金等第三方平台博客不再保证能够同步更新,欢迎移步 GitHub:github.com/kingcos/Per…。谢谢! Lifecycle of UIViewController in iOS Date Notes Swift Xcode 2017-03-10 首次提交 3.0 8.2.1 前言 对象的生命周期一直是开发者所需要关心的,教授 CS193p...

weixin_34314962的博客 293

iOS - UIStoryboard

&#13; 前言 NS_CLASS_AVAILABLE_IOS(5_0) @interface UIStoryboard : NSObject @available(iOS 5.0, *) public class UIStoryboard : NSObject StoryBoard 是苹果在 iOS5 中引入的新技术方案,目的是给纷繁复杂的 nib、x...

rstbfveradsvc 241
上一篇: iOS内存话题: 弱引用下的懒加载
下一篇: iOS AutoLayout: 关联 Xib 和 UIView
veryitman
博客等级 码龄16年 472粉丝 310原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值