Make view cover full screen using CGRectMake

后端 未结 2 860
小蘑菇
小蘑菇 2021-01-19 10:59

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:

相关标签:
2条回答
  • 2021-01-19 11:22

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

    CardIOView *cardIOView = [[CardIOView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    
    0 讨论(0)
  • 2021-01-19 11:25

    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.

    0 讨论(0)
提交回复
热议问题