iPhone 界面尺寸以及各种图表尺寸

iPhone界面尺寸

设备屏幕尺寸开发尺寸状态栏高度导航栏高度

tab栏

高度

高宽比

iPhone

4/4S

3.5英寸 320*48040px88px98px0.66

iPhone

5/5S/5C/SE

4英寸320*56840px88px98px0.56

iPhone

6/6S/7/8

4.7英寸375*66740px88px98px0.56

iPhone

6+/6s+/7+/8+

5.5英寸414*73654px132px98px0.56

iPhone 

X/Xs/

5.8英寸375*812

 88px

88px

98+34

px

0.46

iPhone

Xr

6.1英寸     

iPhone

Xs Max

6.5英寸414*896   0.46

 

iPhone X适配

iPhone图标尺寸

系统分辨率圆角大小
iOS 6-90px – 1024px约为图标宽度 × 0.175
iOS 7+90px – 1024px约为图标宽度 × 0.225
AssetiPhone 6 Plus (@3x)iPhone 6 and iPhone 5 (@2x)iPhone 4s (@2x)iPad and iPad mini (@2x)iPad 2 and iPad mini (@1x)
App icon(required for all apps)180 × 180120 × 120120 × 120152 × 15276 × 76
App icon for the App Store(required for all apps)1024 × 10241024 × 10241024 × 10241024 × 10241024 × 1024
Launch file or image(required for all apps)Use a launch file(see Launch Images)For iPhone 6, use a launch file(see Launch Images)For iPhone 5, 640 × 1136640 × 9601536 × 2048 (portrait)2048 × 1536 (landscape)768 × 1024 (portrait)1024 × 768 (landscape)
Spotlight search results icon(recommended)120 × 12080 × 8080 × 8080 × 8040 × 40
Settings icon(recommended)87 × 8758 × 5858 × 5858 × 5829 × 29
Toolbar and navigation bar icon(optional)About 66 × 66About 44 × 44About 44 × 44About 44 × 44About 22 × 22
Tab bar icon(optional)About 75 × 75(maximum: 144 × 96)About 50 × 50(maximum: 96 × 64)About 50 × 50(maximum: 96 × 64)About 50 × 50(maximum: 96 × 64)About 25 × 25(maximum: 48 × 32)
Default Newsstand cover icon for the App Store(required for Newsstand apps)At least 1024 pixels on the longest edgeAt least 1024 pixels on the longest edgeAt least 1024 pixels on the longest edgeAt least 1024 pixels on the longest edgeAt least 512 pixels on the longest edge

Web clip icon(recommended for web apps and websites)

180 × 180120 × 120120 × 120152 × 152

 

 

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 对于这个问题,我可以回答。你可以使用AVCaptureVideoPreviewLayer的videoGravity属性来实现屏幕尺寸的适应。可以设置为AVLayerVideoGravity.resizeAspectFill以填充整个屏幕,或者设置为AVLayerVideoGravity.resizeAspect以保持视频比例并居中显示。 ### 回答2: AVCaptureVideoPreviewLayer 是 iOS 中用于显示摄像头采集到的实时视频的类。它通常用于实现摄像头预览功能。 在适应不同屏幕尺寸iPhone 上,我们可以使用 Auto Layout 来动态调整 AVCaptureVideoPreviewLayer 的尺寸和位置。 首先,我们需要在 Interface Builder 中添加一个 UIView,作为摄像头预览图层的容器。然后,在代码中通过 AVCaptureVideoPreviewLayer 的 init(with:) 方法来创建预览图层,并将其添加到容器视图上。 接下来,我们可以使用 Auto Layout 来设置容器视图的约束。通过设置容器视图的顶部、底部、左侧和右侧与父视图的约束,让容器视图自动调整大小以适应不同尺寸iPhone 屏幕。这样,AVCaptureVideoPreviewLayer 就会自动跟随容器视图的大小调整而调整。 在代码中,需要设置容器视图的 translatesAutoresizingMaskIntoConstraints 属性为 false,以启用 Auto Layout。然后,我们可以使用 NSLayoutConstraint 或 Visual Format Language 来设置容器视图的约束。 例如,可以使用下面的代码来设置容器视图的顶部、底部、左侧和右侧约束: ```swift containerView.translatesAutoresizingMaskIntoConstraints = false let topConstraint = NSLayoutConstraint(item: containerView, attribute: .top, relatedBy: .equal, toItem: view, attribute: .top, multiplier: 1.0, constant: 0) let bottomConstraint = NSLayoutConstraint(item: containerView, attribute: .bottom, relatedBy: .equal, toItem: view, attribute: .bottom, multiplier: 1.0, constant: 0) let leadingConstraint = NSLayoutConstraint(item: containerView, attribute: .leading, relatedBy: .equal, toItem: view, attribute: .leading, multiplier: 1.0, constant: 0) let trailingConstraint = NSLayoutConstraint(item: containerView, attribute: .trailing, relatedBy: .equal, toItem: view, attribute: .trailing, multiplier: 1.0, constant: 0) view.addConstraints([topConstraint, bottomConstraint, leadingConstraint, trailingConstraint]) ``` 通过设置适当的约束,AVCaptureVideoPreviewLayer 将会自动调整大小以适应不同尺寸iPhone 屏幕。 ### 回答3: AVCaptureVideoPreviewLayer 是 iOS 上用于显示相机预览的一个组件。要使AVCaptureVideoPreviewLayer 适应不同屏幕尺寸iPhone,可以采取以下方法: 1. 动态设置预览层的大小:根据屏幕尺寸的变化,我们可以通过监听屏幕旋转事件或使用Auto Layout来动态更新 AVCaptureVideoPreviewLayer 的frame 或 constraints。例如,在屏幕尺寸变化时,我们可以获取当前的屏幕 bounds,然后将其作为预览层的新frame或更新预览层的constraints,并将其应用于 AVCaptureVideoPreviewLayer。 2. 缩放预览层:如果预览层的大小在不同屏幕尺寸之间存在较大差异时,可以考虑对预览层进行缩放以适应屏幕。可以通过设置预览层的transform属性来实现缩放,例如使用CATransform3D的scale方法。 3. 裁剪预览层:在某些情况下,预览层的纵横比可能与屏幕的纵横比不匹配。如果我们希望完整地显示预览内容而不是进行缩放,我们可以考虑在原始图像上添加黑边或裁剪预览层。可以通过调整预览层的contentsGravity属性来实现裁剪。 需要注意的是,使用AVCaptureVideoPreviewLayer时,我们还需要确保正确设置会话的设备方向,并处理屏幕旋转事件以适应各种屏幕方向。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值