iOS UIImagePickerController, set frame

前端 未结 2 1447
难免孤独
难免孤独 2020-12-18 13:17

I\'m trying to accomplish the following result:

Set the frame of my UIImagePickerController to, lets say 200 x 200,

Set my frame at the bottom-right corner (

2条回答
  •  北荒
    北荒 (楼主)
    2020-12-18 13:25

    You need to use the cameraViewTransform property of UIImagePicker to adjust its camera frame. This property accept any CGAffineTransform you made (e.g. scaling, rotating, inverting, translating, etc).

    For example, if you want to move the camera view down by 50 points and scale the camera view 1.2x its original size, this is how you'll do it:

        CGAffineTransform transform = CGAffineTransformMakeTranslation(0.0f, 50.0f);
        transform = CGAffineTransformScale(transform, 1.2f, 1.2f);
        imagePicker.cameraViewTransform = transform;
    

提交回复
热议问题