iOS - iOS 适配
前言 什么是适配: 适应、兼容各种不同的情况。 iOS 开发中,适配的常见种类: 1)系统适配, 针对不同版本的操作系统进行适配。 2)屏幕适配,针对不同大小的屏幕尺寸进行适配。 iPhone 的尺寸:3.5 inch、4.0 inch、4.7 inch、5.5 inch 。 iPad 的尺寸:7.9 inch、9.7 inch、12.9 inch 。 屏幕方向:竖屏、横屏。 1、系统适配 Objective-C // 获取系统版本 float systemVersion = [UIDevice currentDevice].systemVersion.floatValue; // 判断系统版本 if ([UIDevice currentDevice].systemVersion.floatValue > 9.0) { // iOS 9 及其以上系统运行 } else { // iOS 9 以下系统系统运行 } Swift // 获取系统版本 let systemVersion:Float = NSString(string: UIDevice.current.systemVer...