4

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

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

Heres the code:

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

Here is an example

Here is an example.

Matteo Gobbi
  • 17,697
  • 3
  • 27
  • 41
spogebob92
  • 1,474
  • 4
  • 23
  • 32
  • Are you able to set the frame of the CardIOView in your code to different sizes at any point? It could be that CardIOView is overriding your attempt to resize its frame. I've worked with some third party libraries that do that. – gavdotnet Jun 22 '14 at 13:35
  • Yeah it works with other sizes. There may be a "max size" or something though. Exploring the code atm. – spogebob92 Jun 22 '14 at 15:22
  • will u please tell me how did u solved the frame size problem.I am facing the same problem. – poojathorat Jul 20 '15 at 06:28

2 Answers2

3

Dave from card.io here.

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.

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.)

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.

Dave Goldman
  • 2,229
  • 1
  • 11
  • 13
1

If you want cover all the screen, it is immediate write something like this:

CardIOView *cardIOView = [[CardIOView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
Matteo Gobbi
  • 17,697
  • 3
  • 27
  • 41
  • Its not working, and I kind of want to use auto layout just in case of a larger screen phone this year. Added a image to better explain my situation. – spogebob92 Jun 21 '14 at 10:59