iOS 屏幕适配:autoResizing autoLayout和sizeClass

一.图片解说

--------------------------------------------------------------------------------------------------------------------------------------------------------------

二.AutoLayout

1.前言  

•在iOS程序中,大部分视图控制器都包含了大量的代码用于设置UI布局,设置控件的水平或垂直位置,以确保组件在不同版本的iOS中都能得到合理的布局
•甚至有些程序员希望在不同的设备使用相同的视图控制器,这就给代码添加了更多的复杂性!
•自动布局AutoLayout的引入很好地解决了这一问题!

2.什么是AutoLayout  

•AutoLayout是一种基于约束的,描述性的布局系统
–基于约束:和以往定义frame的位置和尺寸不同,AutoLayout的位置确定是以所谓相对位置的约束来定义的,比如x坐标为superView的中心,y坐标为屏幕底部上方10像素等
–描述性:约束的定义和各个view的关系使用接近自然语言或者可视化语言的方法来进行描述
–布局系统:用来负责界面的各个元素的位置
•AutoLayout为开发者提供了一种不同于传统对于UI元素位置指定的布局方法。以前,不论是在IB里拖放,还是在代码中写,每个UIView都会有自己的frame属性,来定义其在当前视图中的位置和尺寸。而使用AutoLayout,就变为了使用约束条件来定义view的位置和尺寸

3.AutoLayout的优势  

•解决不同分辨率和屏幕尺寸下view的适配问题,同时也简化了旋转时view的位置的定义。原来在底部之上10像素居中的view,不论在旋转屏幕或是更换设备(iPad、iPad mini、iPhone 4或者是iPhone5/iPhone6/iPhone6plus)的时候,始终还在底部之上10像素居中的位置,不会发生变化
•使用约束条件来描述布局,view的frame会依据这些约束来进行计算

4.AutoLayout和Autoresizing Mask的区别  

•在iOS6之前,关于屏幕旋转的适配和iPhone,iPad屏幕的自动适配,基本都是由Autoresizing Mask来完成的。但是随着大家对iOS App的要求越来越高,以及今后可能出现的多种屏幕和分辨率的设备,Autoresizing Mask显得有些落伍和迟钝了。AutoLayout可以完成所有原来Autoresizing Mask能完成的工作,同时还能胜任一些原来无法完成的任务,其中包括:
•AutoLayout可以指定任意两个view的相对位置,而不需要像Autoresizing Mask那样需要两个view在直系的view hierarchy中
•AutoLayout不必须指定相等关系的约束,它可以指定非相等约束(大于或者小于等);而Autoresizing Mask所能做的布局只能是相等条件的
•AutoLayout可以指定约束的优先级,计算frame时将优先按照满足优先级高的条件进行计算

5.AutoLayout的基本使用  

•在创建约束之后,需要将其添加到作用的view上。在添加时要注意目标view需要遵循以下规则
•1)  对于两个同层级view之间的约束关系,添加到他们的父view上
•2)   对于两个不同层级view之间的约束关系,添加到他们最近的共同父view上
•3)  对于有层次关系的两个view之间的约束关系,添加到层次较高的父view上

6.添加和刷新约束(代码)  

-(void)addConstraint:(NSLayoutConstraint *)constraint

•刷新约束的改变

-setNeedsUpdateConstraints

-layoutIfNeeded

[button setTranslatesAutoresizingMaskIntoConstraints:NO];

1
2
3
4
5
6
7
8
9
// 2.1 水平方向的约束
NSLayoutConstraint *constraintX = [NSLayoutConstraint constraintWithItem:button attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeCenterX multiplier:1.0f constant:0.0f];
[self.view addConstraint:constraintX];
// 2.2 垂直方向的约束
NSLayoutConstraint *constraintY = [NSLayoutConstraint constraintWithItem:button attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeCenterY multiplier:1.0f constant:0.0f];
[self.view addConstraint:constraintY]; 

6.使用AutoLayout容易出现的错误 

•Ambiguous Layout 布局不能确定,即给出的约束条件无法唯一确定一种布局,也就是约束条件不足,无法得到唯一的布局结果。这种情况一般添加一些必要的约束或者调整优先级可以解决
•Unsatisfiable Constraints 无法满足约束,问题来源是有约束条件互相冲突,因此无法同时满足,需要删掉一些约束
•现在使用IB可以比较容易地完成复杂约束,在实际开发中很少再会遇到遗漏或者多余约束情况的出现,有问题的约束条件将直接在IB中得到错误或者警告。
三.快速领会VFL语言Demo代码:
demo代码如下:

/* Initial views setup */- (void)setupViews
{self.redView = [UIView new];self.redView.translatesAutoresizingMaskIntoConstraints = NO;self.redView.backgroundColor = [UIColor colorWithRed:0.95 green:0.47 blue:0.48 alpha:1.0];self.yellowView = [UIView new];self.yellowView.translatesAutoresizingMaskIntoConstraints = NO;self.yellowView.backgroundColor = [UIColor colorWithRed:1.00 green:0.83 blue:0.58 alpha:1.0];[self.view addSubview:self.redView];[self.view addSubview:self.yellowView];}/* Hey Devs... the code in the next functions has to be intended for tutorial purposes only. I have created work-alone examples that contain a lot of code duplication... not a good practice but way easier to explain :P
*//* EXAMPLE 1 */- (void)example_1
{// 1. Create a dictionary of viewsNSDictionary *viewsDictionary = @{@"redView":self.redView};// 2. Define the redView SizeNSArray *constraint_H = [NSLayoutConstraint constraintsWithVisualFormat:@"V:[redView(100)]"options:0metrics:nilviews:viewsDictionary];NSArray *constraint_V = [NSLayoutConstraint constraintsWithVisualFormat:@"H:[redView(100)]"options:0metrics:nilviews:viewsDictionary];[self.redView addConstraints:constraint_H];[self.redView addConstraints:constraint_V];// 3. Define the redView PositionNSArray *constraint_POS_V = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|-30-[redView]"options:0metrics:nilviews:viewsDictionary];NSArray *constraint_POS_H = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|-20-[redView]"options:0metrics:nilviews:viewsDictionary];// 3.B ...and try to change the visual format string//NSArray *constraint_POS_V = [NSLayoutConstraint constraintsWithVisualFormat:@"V:[redView]-30-|" options:0 metrics:nil views:viewsDictionary];//NSArray *constraint_POS_H = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[redView]" options:0 metrics:nil views:viewsDictionary];[self.view addConstraints:constraint_POS_H];[self.view addConstraints:constraint_POS_V];
}/* EXAMPLE 2 */- (void)example_2
{// 1. Create a dictionary of viewsNSDictionary *viewsDictionary = @{@"redView":self.redView, @"yellowView":self.yellowView};// 2. Define the views SizesNSArray *red_constraint_H = [NSLayoutConstraint constraintsWithVisualFormat:@"V:[redView(100)]"options:0metrics:nilviews:viewsDictionary];NSArray *red_constraint_V = [NSLayoutConstraint constraintsWithVisualFormat:@"H:[redView(100)]"options:0metrics:nilviews:viewsDictionary];[self.redView addConstraints:red_constraint_H];[self.redView addConstraints:red_constraint_V];NSArray *yellow_constraint_H = [NSLayoutConstraint constraintsWithVisualFormat:@"V:[yellowView(200)]"options:0metrics:nilviews:viewsDictionary];NSArray *yellow_constraint_V = [NSLayoutConstraint constraintsWithVisualFormat:@"H:[yellowView(100)]"options:0metrics:nilviews:viewsDictionary];[self.yellowView addConstraints:yellow_constraint_H];[self.yellowView addConstraints:yellow_constraint_V];// 3. Define the views PositionsNSArray *constraint_POS_V = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|-30-[redView]-40-[yellowView]"options:0metrics:nilviews:viewsDictionary];NSArray *constraint_POS_H = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|-20-[redView]-10-[yellowView]"options:0metrics:nilviews:viewsDictionary];[self.view addConstraints:constraint_POS_V];[self.view addConstraints:constraint_POS_H];}/* EXAMPLE 3 */- (void)example_3
{// 1. Create a dictionary of viewsNSDictionary *viewsDictionary = @{@"redView":self.redView, @"yellowView":self.yellowView};// 2. Define the views SizesNSArray *red_constraint_H = [NSLayoutConstraint constraintsWithVisualFormat:@"V:[redView(100)]"options:0metrics:nilviews:viewsDictionary];NSArray *red_constraint_V = [NSLayoutConstraint constraintsWithVisualFormat:@"H:[redView(100)]"options:0metrics:nilviews:viewsDictionary];[self.redView addConstraints:red_constraint_H];[self.redView addConstraints:red_constraint_V];NSArray *yellow_constraint_H = [NSLayoutConstraint constraintsWithVisualFormat:@"V:[yellowView(150)]"options:0metrics:nilviews:viewsDictionary];NSArray *yellow_constraint_V = [NSLayoutConstraint constraintsWithVisualFormat:@"H:[yellowView(100)]"options:0metrics:nilviews:viewsDictionary];[self.yellowView addConstraints:yellow_constraint_H];[self.yellowView addConstraints:yellow_constraint_V];// 3. Define the views Positions using optionsNSArray *constraint_POS_V = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|-120-[redView]"options:0metrics:nilviews:viewsDictionary];NSArray *constraint_POS = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|-20-[redView]-10-[yellowView]"options:NSLayoutFormatAlignAllTopmetrics:nil views:viewsDictionary];[self.view addConstraints:constraint_POS_V];[self.view addConstraints:constraint_POS];}/* EXAMPLE 4 */- (void)example_4
{// 1. Create a dictionary of views and metricsNSDictionary *viewsDictionary = @{@"redView":self.redView, @"yellowView":self.yellowView};NSDictionary *metrics = @{@"redWidth": @100,@"redHeight": @100,@"yellowWidth": @100,@"yellowHeight": @150,@"topMargin": @120,@"leftMargin": @20,@"viewSpacing":@10};// 2. Define the views SizesNSArray *red_constraint_H = [NSLayoutConstraint constraintsWithVisualFormat:@"V:[redView(redHeight)]"options:0metrics:metricsviews:viewsDictionary];NSArray *red_constraint_V = [NSLayoutConstraint constraintsWithVisualFormat:@"H:[redView(redWidth)]"options:0metrics:metricsviews:viewsDictionary];[self.redView addConstraints:red_constraint_H];[self.redView addConstraints:red_constraint_V];NSArray *yellow_constraint_H = [NSLayoutConstraint constraintsWithVisualFormat:@"V:[yellowView(yellowHeight)]"options:0metrics:metricsviews:viewsDictionary];NSArray *yellow_constraint_V = [NSLayoutConstraint constraintsWithVisualFormat:@"H:[yellowView(yellowWidth)]"options:0metrics:metricsviews:viewsDictionary];[self.yellowView addConstraints:yellow_constraint_H];[self.yellowView addConstraints:yellow_constraint_V];// 3. Define the views PositionsNSArray *constraint_POS_V = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|-topMargin-[redView]"options:0metrics:metricsviews:viewsDictionary];NSArray *constraint_POS = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|-leftMargin-[redView]-viewSpacing-[yellowView]"options:NSLayoutFormatAlignAllTopmetrics:metricsviews:viewsDictionary];[self.view addConstraints:constraint_POS_V];[self.view addConstraints:constraint_POS];
}/* EXAMPLE 5 */- (void)example_5
{// 1. Create a dictionary of views and metricsNSDictionary *viewsDictionary = @{@"redView":self.redView};NSDictionary *metrics = @{@"vSpacing":@30, @"hSpacing":@10};// 2. Define the view Position and automatically the SizeNSArray *constraint_POS_V = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|-vSpacing-[redView]-vSpacing-|"options:0metrics:metricsviews:viewsDictionary];NSArray *constraint_POS_H = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|-hSpacing-[redView]-hSpacing-|"options:0metrics:metricsviews:viewsDictionary];[self.view addConstraints:constraint_POS_V];[self.view addConstraints:constraint_POS_H];
}/* EXAMPLE 6 */- (void)example_6
{// 1. Create a dictionary of viewsNSDictionary *viewsDictionary = @{@"redView": self.redView, @"yellowView": self.yellowView};NSDictionary *metrics = @{@"vSpacing":@30, @"hSpacing":@10};// 2. Define the view Position and automatically the Size (for the redView)NSArray *constraint_POS_V = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|-vSpacing-[redView]-vSpacing-|"options:0metrics:metricsviews:viewsDictionary];NSArray *constraint_POS_H = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|-hSpacing-[redView]-hSpacing-|"options:0metrics:metricsviews:viewsDictionary];[self.view addConstraints:constraint_POS_V];[self.view addConstraints:constraint_POS_H];// 3. Define sizes thanks to relations with another view (yellowView in relation with redView)[self.view addConstraint:[NSLayoutConstraintconstraintWithItem:self.yellowViewattribute:NSLayoutAttributeWidthrelatedBy:NSLayoutRelationEqualtoItem:self.redViewattribute:NSLayoutAttributeWidthmultiplier:0.5constant:0.0]];[self.view addConstraint:[NSLayoutConstraintconstraintWithItem:self.yellowViewattribute:NSLayoutAttributeHeightrelatedBy:NSLayoutRelationEqualtoItem:self.redViewattribute:NSLayoutAttributeHeightmultiplier:0.5constant:0.0]];// 4. Define position thanks to relations with another view (yellowView in relation with redView)[self.view addConstraint:[NSLayoutConstraintconstraintWithItem:self.yellowViewattribute:NSLayoutAttributeCenterXrelatedBy:NSLayoutRelationEqualtoItem:self.redViewattribute:NSLayoutAttributeCenterXmultiplier:1.0constant:0.0]];[self.view addConstraint:[NSLayoutConstraintconstraintWithItem:self.yellowViewattribute:NSLayoutAttributeCenterYrelatedBy:NSLayoutRelationEqualtoItem:self.redViewattribute:NSLayoutAttributeCenterYmultiplier:1.0constant:0.0]];}
四.用Masonry开源第三方库写VFL语言

Masonry -- 使用纯代码进行iOS应用的autolayout自适应布局

简介

简化iOS应用使用纯代码机型自适应布局的工作,使用一种简洁高效的语法替代NSLayoutConstraints.

  • 项目主页: Masonry
  • 最新示例: 点击下载
  • 项目简议: 如果再看到关于纯代码,xib或storyboard,使用哪种方式进行UI布局更合适的讨论,请推荐他们先试用下 Masonry. Masonry,像xib一样快速,同时拥有作为纯代码方式的灵活性 -- github关注度 7800 + 是有原因的!

快速入门

安装

使用 CocoaPods 安装

pod 'Masonry'

推荐在你的在 prefix.pch 中引入头文件:

// 定义这个常量,就可以在使用Masonry不必总带着前缀 `mas_`:
#define MAS_SHORTHAND// 定义这个常量,以支持在 Masonry 语法中自动将基本类型转换为 object 类型:
#define MAS_SHORTHAND_GLOBALS#import "Masonry.h"

使用

初始Masonry

这是使用MASConstraintMaker创建的约束:

/* 注意:view1应首先添加为某个视图的子视图,superview是一个局部变量,指view1的父视图. */UIEdgeInsets padding = UIEdgeInsetsMake(10, 10, 10, 10); [view1 mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(superview.mas_top).offset(padding.top); make.left.equalTo(superview.mas_left).offset(padding.left); make.bottom.equalTo(superview.mas_bottom).offset(-padding.bottom); make.right.equalTo(superview.mas_right).offset(-padding.right); }];

甚至可以更短:

[view1 mas_makeConstraints:^(MASConstraintMaker *make) {make.edges.equalTo(superview).insets(padding);
}];

不止可以表达相等关系

.equalTo 等价于 NSLayoutRelationEqual

.lessThanOrEqualTo 等价于 NSLayoutRelationLessThanOrEqual

.greaterThanOrEqualTo 等价于 NSLayoutRelationGreaterThanOrEqual

这三个表达相等关系的语句,可以接受一个参数;此参数可以为以下任意一个:

1. MASViewAttribute

make.centerX.lessThanOrEqualTo(view2.mas_left);
MASViewAttribute NSLayoutAttribute
view.mas_left NSLayoutAttributeLeft
view.mas_right NSLayoutAttributeRight
view.mas_top NSLayoutAttributeTop
view.mas_bottom NSLayoutAttributeBottom
view.mas_leading NSLayoutAttributeLeading
view.mas_trailing NSLayoutAttributeTrailing
view.mas_width NSLayoutAttributeWidth
view.mas_height NSLayoutAttributeHeight
view.mas_centerX NSLayoutAttributeCenterX
view.mas_centerY NSLayoutAttributeCenterY
view.mas_baseline NSLayoutAttributeBaseline

2. UIView/NSView

如果你需要 view.left 大于或等于label.left:

// 下面两个约束是完全等效的.
make.left.greaterThanOrEqualTo(label);
make.left.greaterThanOrEqualTo(label.mas_left);

3. NSNumber

自适应布局允许将宽度或高度设置为固定值.
如果你想要给视图一个最小或最大值,你可以这样:

//width >= 200 && width <= 400
make.width.greaterThanOrEqualTo(@200);
make.width.lessThanOrEqualTo(@400)

但是自适应布局不支持将 left,right, centerY等设为固定值.
如果你给这些属性传递一个常量, Masonry会自动将它们转换为相对于其父视图的相对值:

//creates view.left = view.superview.left + 10
make.left.lessThanOrEqualTo(@10)

除了使用 NSNumber 外,你可以使用基本数据类型或者结构体来创建约束:

make.top.mas_equalTo(42);
make.height.mas_equalTo(20); make.size.mas_equalTo(CGSizeMake(50, 100)); make.edges.mas_equalTo(UIEdgeInsetsMake(10, 0, 10, 0)); make.left.mas_equalTo(view).mas_offset(UIEdgeInsetsMake(10, 0, 10, 0));

4. NSArray

一个数组,里面可以混合是前述三种类型的任意几种:

// 表达三个视图等高的约束.
make.height.equalTo(@[view1.mas_height, view2.mas_height]); make.height.equalTo(@[view1, view2]); make.left.equalTo(@[view1, @100, view3.right]);

约束的优先级

.priority 允许你指定一个精确的优先级,数值越大优先级越高.最高1000.

.priorityHigh 等价于 UILayoutPriorityDefaultHigh.优先级值为 750.

.priorityMedium 介于高优先级和低优先级之间,优先级值在 250~750之间.

.priorityLow 等价于 UILayoutPriorityDefaultLow, 优先级值为 250.

优先级可以在约束的尾部添加:

make.left.greaterThanOrEqualTo(label.mas_left).with.priorityLow(); make.top.equalTo(label.mas_top).with.priority(600);

等比例自适应

.multipliedBy 允许你指定一个两个视图的某个属性等比例变化

item1.attribute1 = multiplier × item2.attribute2 + constant,此为约束的计算公式, .multipliedBy本质上是用来限定 multiplier

注意,因为编程中的坐标系从父视图左上顶点开始,所以指定基于父视图的left或者top的multiplier是没有意义的,因为父视图的left和top总为0.

如果你需要一个视图随着父视图的宽度和高度,位置自动变化,你应该同时指定 right,bottom,width,height与父视图对应属性的比例(基于某个尺寸下的相对位置计算出的比例),并且constant必须为0.

// 指定宽度为父视图的 1/4.
make.width.equalTo(superview).multipliedBy(0.25);

工具方法

Masonry提供了一些工具方法来进一步简化约束的创建.

edges 边界

//使 top, left, bottom, right等于 view2
make.edges.equalTo(view2);//使 top = superview.top + 5, left = superview.left + 10,
// bottom = superview.bottom - 15, right = superview.right - 20 make.edges.equalTo(superview).insets(UIEdgeInsetsMake(5, 10, 15, 20))

size 尺寸

// 使宽度和高度大于或等于 titleLabel
make.size.greaterThanOrEqualTo(titleLabel)//使 width = superview.width + 100, height = superview.height - 50
make.size.equalTo(superview).sizeOffset(CGSizeMake(100, -50))

center 中心

//使 centerX和 centerY = button1
make.center.equalTo(button1)//使 centerX = superview.centerX - 5, centerY = superview.centerY + 10
make.center.equalTo(superview).centerOffset(CGPointMake(-5, 10))

你可以使用链式语法来增强代码可读性:

// 除top外,其他约束都与父视图相等.
make.left.right.bottom.equalTo(superview); make.top.equalTo(otherView);

更新约束

有时,你需要修改已经存在的约束来实现动画效果或者移除/替换已有约束.
在 Masonry 中,有几种不同的更新视图约束的途径:

1. References 引用

你可以把 Masonry 语法返回的约束或约束数组,存储到一个局部变量或者类的属性中,以供后续操作某个约束.

// 声明属性
@property (nonatomic, strong) MASConstraint *topConstraint;...// when making constraints [view1 mas_makeConstraints:^(MASConstraintMaker *make) { self.topConstraint = make.top.equalTo(superview.mas_top).with.offset(padding.top); make.left.equalTo(superview.mas_left).with.offset(padding.left); }]; ... // 然后你就可以操作这个属性. [self.topConstraint uninstall];

2. mas_updateConstraints

如果你只是想添加新的约束,你可以使用便利方法mas_updateConstraints,不需要使用 mas_makeConstraintsmas_updateConstraints,不会移除已经存在的约束(即使新旧约束间相互冲突).

// 重写视图的updateConstraints方法: 这是Apple推荐的添加/更新约束的位置.
// 这个方法可以被多次调用以响应setNeedsUpdateConstraints方法.
// setNeedsUpdateConstraints 可以被UIKit内部调用或者由开发者在自己的代码中调用以更新视图约束.
- (void)updateConstraints {[self.growingButton mas_updateConstraints:^(MASConstraintMaker *make) { make.center.equalTo(self); make.width.equalTo(@(self.buttonSize.width)).priorityLow(); make.height.equalTo(@(self.buttonSize.height)).priorityLow(); make.width.lessThanOrEqualTo(self); make.height.lessThanOrEqualTo(self); }]; //根据apple机制,最后应调用父类的updateConstraints方法. [super updateConstraints]; }

3. mas_remakeConstraints

mas_remakeConstraintsmas_updateConstraints相似,不同之处在于: mas_remakeConstraints 会先移除视图上已有的约束,再去创建新的约束.

- (void)changeButtonPosition {[self.button mas_remakeConstraints:^(MASConstraintMaker *make) {make.size.equalTo(self.buttonSize); if (topLeft) { make.top.and.left.offset(10); } else { make.bottom.and.right.offset(-10); } }]; }

转载于:https://www.cnblogs.com/LifeTechnologySupporter/p/5018185.html

iOS-屏幕适配-UI布局相关推荐

  1. IOS 屏幕适配(一)理论篇

    IOS 屏幕适配(一)理论篇 1. IOS 屏幕适配基本概念 1.1 IOS 设备的尺寸和分辨率 1.1.1 分辨率相关概念 1.1.2 IOS 各个设备对应的分辨率 1.2 设计和开发之间的多屏适配 ...

  2. IOS 屏幕适配理论篇

    @[TOC](IOS 屏幕适配(一)理论篇) 1. IOS 屏幕适配基本概念 1.1 IOS 设备的尺寸和分辨率 1.1.1 分辨率相关概念 点(Points): 是iOS开发中引入的抽象单位,称作点 ...

  3. Android高手笔记-屏幕适配 UI优化

    Android高手笔记-屏幕适配 & UI优化 屏幕与适配 由于Android碎片化严重,屏幕分辨率千奇百怪,而想要在各种分辨率的设备上显示基本一致的效果,适配成本越来越高: 屏幕适配究其根本 ...

  4. IOS屏幕适配(四)最新系统IOS13适配

    IOS屏幕适配(四)最新系统IOS13适配 3. IOS 最新系统适配问题 3.1 IOS 13 适配 3.1.1 即将废弃的 LaunchImage 3.1.2 Sign in with Apple ...

  5. android百分比布局适配,安卓屏幕适配-百分比布局

    屏幕适配-百分比布局 原理:以父容器尺寸作为参考,在View的加载过程,根据当前父容器实际尺寸换算出目标尺寸,在作用在View上. 百分比布局实际是对容器的一中扩展,扩展的是宽高等比例的设置. 1.自 ...

  6. IOS开发之——屏幕适配-AutoLayout布局实现(02)

    一 概述 关于AutoLayout的几个概念 通过布局实现屏幕适配 二 关于AutoLayout的几个概念 2.1 什么是Autolayout Autolayout是一种"自动布局" ...

  7. iOS开发~UI布局(二)storyboard中autolayout和size class的使用详解

    一.概要:前一篇初步的描述了size class的概念,那么实际中如何使用呢,下面两个问题是我们一定会遇到的: 1.Xcode6中增加了size class,在storyboard中如何使用? 2.a ...

  8. html5开发之ios屏幕适配,iOS开发屏幕尺寸以及屏幕适配等问题(转载内容)

    原帖地址:http://blog.csdn.net/phunxm/article/details/42174937/ 仅供我个人收藏学习,原博主如不同意请联系qq651263878进行删除,在此表示感 ...

  9. (转)iOS 屏幕适配

    参考 微信的多屏适配 目前为止,iPhone屏幕尺寸已经有四种: 3.5(inch):1/3G/3GS/4/4S 4.0(inch):5/5S/5C 4.7(inch):6 5.5(inch):6Pl ...

  10. iOS 屏幕适配 iPhone X SafeArea安全区域

    三月份工作 9月份才开始自己主动了解安全区域适配问题 一. 前言 本文的出发点是对iOS设备的适配, 我们之前的适配只是考虑设备的尺寸, 设备的方向, 而在iPhoneX出来之后呢, 我们又多了一种考 ...

最新文章

  1. 微信小程序 - this.triggerEvent()
  2. expdp备份速度慢的问题
  3. UML对象关系与箭头对应表
  4. DTCC 2020 | 阿里云吉剑南:在线分析进入Fast Data时代的关键技术解读
  5. iOS开发中 常用枚举和常用的一些运算符(易错总结)
  6. 某个知名技术论坛用户名和密码泄露(第一部分)
  7. 你知道,java项目中是如何获取文件地址的吗?
  8. 【LeetCode】461. Hamming Distance (java实现)
  9. 计算机控制系统报告,计算机控制系统实验报告一
  10. 前期交互流程(PTES的第一步)
  11. word2016自带公式编辑器转换成mathtype类型公式,以及设置公式大小
  12. matlab 安装coder工具包,matlab coder 工具箱使用教程
  13. iTop开源 ITSM/ITIL 系统部署(16 图)
  14. iOS关闭键盘的两种简单方法
  15. 游戏开发/游戏制作/游戏生成 , godot
  16. 张志华-统计机器学习-随机变量
  17. java jdk17 Tomcat
  18. 【2018-11-09】中证500指数的估值详情
  19. java毕业生设计信管专业毕业生就业管理信息系统计算机源码+系统+mysql+调试部署+lw
  20. CR-InSAR技术边坡监测

热门文章

  1. java 有界泛型_JAVA泛型中的有界类型(extends super)
  2. 华为鸿蒙系统再公测,安卓再见!华为正式发布鸿蒙系统公测版!
  3. Unity 连接MySql数据库
  4. Servlet和Tomcat底层分析
  5. creo不完全约束_Creo绘图1:1输出AutoCAD配置方法详解,工程图输出再不用担心尺寸乱变!...
  6. 动画效果之 Canvas学习-globalCompositeOperation详解
  7. javascript基础之拖拽(2)(详细篇)---FileReader对象,blod对象
  8. Spring boot 2.x 错误处理机制 与 定制错误页面
  9. [转]输入框对齐问题
  10. VMware与宿主机同一网段