简体   繁体   English

xcode uiimageview背景图片

[英]xcode uiimageview background image

I am relatively new to Obj-C so thanks in advance. 我是Obj-C的新手,所以在此先感谢。

I have a UIImageView on the storyboard. 我在故事板上有一个UIImageView。 I have a Tap Gesture Recognizer over it. 我有一个Tap Gesture识别器。 When the user taps, the choose/take photo option comes up and the image view is correctly updated with the photo. 当用户点击时,将出现“选择/拍摄照片”选项,并且已使用照片正确更新了图像视图。 What I want to do is have the UIImageView have a camera icon png in it until the user chooses the photo. 我想要做的是让UIImageView中有一个照相机图标png,直到用户选择照片为止。

Step 1 第1步

saving the image to Document Director which selected from camera roll. 将图像保存到从相机胶卷中选择的Document Director。

Step 2 第2步

When you are saving then you can check wether there is saved file or not if no saved file then show camera icon in UIImageView otherwise show saved image 当你保存时,你可以检查是否有保存的文件,如果没有保存的文件,然后在UIImageView中显示相机图标,否则显示保存的图像

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM