使用CGRectMake使视图封面全屏显示 [英] Make view cover full screen using CGRectMake

查看:180
本文介绍了使用CGRectMake使视图封面全屏显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个视图(使用card.io),我希望视图覆盖整个屏幕。

I'm creating a view (using card.io), and I want the view to cover the full screen.

它仅覆盖约2/3的屏幕atm。

Its only covering about 2/3rds of the screen atm.

下面是代码:

 CardIOView *cardIOView = [[CardIOView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width,self.view.frame.size.height)];

以下是一个例子

推荐答案

来自card.io的Dave。

Dave from card.io here.

创建 CardIOView 时,其框架将会显示你设定的大小。但是,(透明) CardIOView 中的摄像机视图将具有标准的iOS摄像头外形尺寸4:3。

When you create a CardIOView, its frame will take on whatever size you set. However, the camera view within the (transparent) CardIOView will have the standard iOS camera form factor of 4:3.

因此,如果CardIOView是320点宽,那么它的相机视图将是~426点高。 (您可以通过检查 CardIOView cameraPreviewFrame 属性来确认这一点。)

So if the CardIOView is 320 points wide, then its camera view will be ~426 points tall. (You can confirm this by checking the cameraPreviewFrame property of your CardIOView.)

根据这些信息,您应该可以设置 CardIOView 的框架,以便将摄像机图像显示在屏幕上显示的位置。您可能希望将 CardIOView 或包含视图的背景颜色设置为黑色。您可能会也可能不会选择隐藏导航栏。

Given this information, you should be able to set the frame of your CardIOView so that the camera image appears where you'd like it to appear onscreen. You will probably want to set the background color of either the CardIOView or of your containing view to black. And you may or may not choose to hide the navigation bar.

这篇关于使用CGRectMake使视图封面全屏显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆