我试图使用UIImagePickerController与UIImagePickerControllerSourceTypePhotoLibrary,但它说,“没有照片”。模拟器从哪里获得图像?我应该在哪里复制图像,以便它们在模拟器中显示?
当前回答
quit the simulator.
Run simulator from the dock by clicking on it.
Drag & drop the image into simulator which you want to add.
it will open image in safari .
tap and hold the image and click the save option.
then open gallery and you will see the image which u had saved recently.
其他回答
quit the simulator.
Run simulator from the dock by clicking on it.
Drag & drop the image into simulator which you want to add.
it will open image in safari .
tap and hold the image and click the save option.
then open gallery and you will see the image which u had saved recently.
一个更简单的方法是: 在模拟器>上打开safari,点击www.google.com 搜索随机照片“自然” 打开每个图像,按下并保存。
在iOS 8.0中,我们添加了将图像拖放到iOS模拟器中的功能。您可以将一堆图像拖到窗口中,它们应该被导入到该模拟设备的照片卷轴中。您还可以使用simctl命令行工具完成此操作。xrun simctl addphoto
以上这些答案在iOS 15上都不适用。
我简单地打开文件应用程序,拖放图像在那里。它会自动将图片导入到照片应用程序中,我可以通过模拟器在任何地方使用。
干杯!
只需拖放图像到iphone模拟器。浏览器将打开显示您的图像。 按下图像,直到你没有收到保存图像的选项。然后保存图像。 就是这样:)。你会看到你的图像在你的模拟器....的照片应用程序
推荐文章
- 如何删除默认的导航栏空间在SwiftUI导航视图
- Ios模拟器:如何关闭应用程序
- 如何在iOS中使用Swift编程segue
- Swift -整数转换为小时/分钟/秒
- Swift:声明一个空字典
- 在成功提交我的应用程序后,“太多符号文件”
- 首先添加一个UIView,甚至是导航栏
- 我如何改变UIButton标题颜色?
- 在Swift中如何调用GCD主线程上的参数方法?
- NSLayoutConstraints是可动画的吗?
- iOS -构建失败,CocoaPods无法找到头文件
- Xcode 4挂在“附加到(应用程序名称)”
- CFNetwork SSLHandshake iOS 9失败
- 请求失败:不可接受的内容类型:文本/html使用AFNetworking 2.0
- 缺少推荐的图标文件-该包不包含iPhone / iPod Touch的应用程序图标,像素为“120x120”,png格式