iphone – 配置UIImagePickerController的帧大小

iphone – 配置UIImagePickerController的帧大小,第1张

概述是否可以更改UI ImagePickerController的可显示帧大小?我想显示摄像机视图,但不是在整个屏幕上,而是在100×100的边框中显示. 这是我的viewDidAppear: - (void) viewDidAppear:(BOOL)animated {UIImagePickerController *picker = [[UIImagePickerController allo 是否可以更改UI ImagePickerController的可显示帧大小?我想显示摄像机视图,但不是在整个屏幕上,而是在100×100的边框中显示.

这是我的vIEwDIDAppear:

- (voID) vIEwDIDAppear:(BOol)animated {UIImagePickerController *picker = [[UIImagePickerController alloc] init];picker.sourceType = UIImagePickerControllerSourceTypeCamera;picker.showsCameraControls = NO;picker.cameraDevice = UIImagePickerControllerCameraDeviceFront;picker.cameraviewtransform = CGAffinetransformScale(picker.cameraviewtransform,CAMERA_transform_X,CAMERA_transform_Y);[self presentModalVIEwController:picker animated:YES];  [super vIEwDIDAppear:YES]; }

我找不到办法在任何地方做到这一点……没有人使用它吗?

解决方法 我尝试了上一篇文章中的代码,并评论了最终的缩放变换((使其成为全尺寸的变换)并且我最终在屏幕中间浮动了一个漂亮的微型相机imagePicker,所以它肯定能够工作!我使用的确切代码,包括缩放/淡入过渡,是 –

UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];imagePickerController.delegate = self;imagePickerController.mediaTypes = [NSArray arrayWithObjects:(Nsstring *)kUTTypeImage,nil];imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;imagePickerController.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;UIVIEw *controllerVIEw = imagePickerController.vIEw;controllerVIEw.Alpha = 0.0;controllerVIEw.transform = CGAffinetransformMakeScale(0.5,0.5);[[[[UIApplication sharedApplication] delegate] window] addSubvIEw:controllerVIEw];[UIVIEw animateWithDuration:0.3                  delay:0.0                options:UIVIEwAnimationoptionCurvelinear             animations:^{                 controllerVIEw.Alpha = 1.0;             }             completion:nil ];[imagePickerController release];

我相信你可以更多地定制它,改变尺寸和尺寸.摄像机视图的位置.

总结

以上是内存溢出为你收集整理的iphone – 配置UIImagePickerController的帧大小全部内容,希望文章能够帮你解决iphone – 配置UIImagePickerController的帧大小所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1058373.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存