ScalableLayoutKit
ScalableLayoutKit
是一个轻量级的SDK,可让您跨任何屏幕大小的Apple设备设计可伸缩、一致的用户界面(UI)。
ScalableLayoutKit
减少了开发者在为所有可能的设备屏幕尺寸(如iPhone XS Max
、iPhone XS
、iPhone XR
、iPhone X
、iPhone 8 Plus
、iPhone 8
、iPhone 7 Plus
、iPhone 7
、iPhone 6s Plus
、iPhone 6s
和iPhone SE
)创建一致的UI设计时的耗时和精力。
使用方法
只需使用ScalableLayoutKit的一个方法即可。
public func scaledLayoutDesign(from srcScreen: Screen = .iPhone6)
使用ScalableLayoutKit
import ScalableLayoutKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Here we just need to passed based or source design screen name only.
self.view.scaledLayoutDesign(from: .iPhoneX)
}
}
如果您在您的应用程序中使用ScalableLayoutKit
,我非常愿意听到您的反馈。您可以通过Twitter或发邮件给我。
示例
要运行示例项目,请先克隆仓库,然后从示例目录中运行pod install
。
安装
ScalableLayoutKit 可通过 CocoaPods 获取。要安装它,只需将以下行添加到您的 Podfile 中
pod 'ScalableLayoutKit'
作者
如果您想联系我,请发送电子邮件至:[email protected]
许可
ScalableLayoutKit 在 MIT 许可下可用。有关更多信息,请参阅 LICENSE 文件。