简体   繁体   English

从库中创建照相亭以挑选图像

[英]Create a photo booth from library to pick images

I'm new to xcode.我是 xcode 的新手。 I am trying to create a photo booth which appears at the bottom (as the one in the image) so that i can make multiple selections and view the result at the top.我正在尝试创建一个显示在底部的照相亭(如图像中的那个),以便我可以进行多项选择并在顶部查看结果。 Any knows how this can be achieved?有谁知道这是如何实现的? 图片

You have to implement UICollectionView for photo booth.您必须为照相亭实施 UICollectionView。

For UI design follow the given steps,对于UI 设计,请遵循给定的步骤,

  1. Create a UIViewController创建一个 UIViewController
  2. Add UICollectionView on UIViewController在 UIViewController 上添加 UICollectionView
  3. Set constraint according to your UI design根据您的 UI 设计设置约束
  4. Set UICollectionCell height and width same and set mini spacing whatever you want in For cells 5 and For lines 5将 UICollectionCell 的高度和宽度设置为相同,并在 For cell 5 和 For lines 5 中设置任何你想要的最小间距

and for programming part ,编程部分

  1. Take data from where you get json parsing or your static data.从您获得 json 解析或静态数据的位置获取数据。
  2. Store in one array and reload UICollectionView存储在一个数组中并重新加载 UICollectionView
  3. Then assign data to your UICollectionView using their delegates and datasource methods.然后使用它们的委托和数据源方法将数据分配给您的 UICollectionView。

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

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