ios - UIImagePickerController 不显示所选图像
<p><p>我有一个 UIImagePickerController,我在 Ipad 中使用它,但是当您选择其中一张图像时,这里什么都没有发生,这是选择器的代码:</p>
<pre><code>- (IBAction)addPicture:(id)sender {
CGRect rect = CGRectMake(0, 0, 753, 118);
;
}
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
;
patientPicture = ;
UIImageView *pictureView = (UIImageView *);
pictureView.image = patientPicture;
;
}
-(void)viewDidLoad {
pickerController = [ init];
popOverController = [ initWithContentViewController:pickerController];
popOverController.delegate = self;
}
</code></pre>
<p>发生的情况是图像选择器加载正常,但当我去选择其中一张图片时,什么都没有发生</p>
<p>提前致谢</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>调用:</p>
<pre><code>;
</code></pre>
<p>最后而不是第一个。</p>
<p>还有……</p>
<pre><code>@interface yourViewController ()<UIImagePickerControllerDelegate,UINavigationControllerDelegate>
</code></pre>
<p>你没有设置pickerController委托(delegate)...</p>
<pre><code>pickerController.delegate = self;
</code></pre>
<p>因为你有一个弹出框使用这个..</p>
<pre><code>;
</code></pre></p>
<p style="font-size: 20px;">关于ios - UIImagePickerController 不显示所选图像,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/18344875/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/18344875/
</a>
</p>
页:
[1]