uicollectionview

UITableVIew与UICollectionView带动画删除cell时崩溃的处理

大憨熊 提交于 2020-03-18 05:08:13
UITableVIew与UICollectionView带动画删除cell时崩溃的处理 -会崩溃的原因是因为没有处理好数据源与cell之间的协调关系- 效果: tableView的源码: ModelCell.h + ModelCell.m // // ModelCell.h // Set // // Created by YouXianMing on 14/11/24. // Copyright (c) 2014年 YouXianMing. All rights reserved. // #import <UIKit/UIKit.h> @class ModelCell; @protocol ModelCellDelegate <NSObject> @optional - (void)modelCellButton:(ModelCell *)cell; @end @interface ModelCell : UITableViewCell @property (nonatomic, weak) id<ModelCellDelegate> delegate; @property (nonatomic, strong) UILabel *title; @end // // ModelCell.m // Set // // Created by YouXianMing on 14/11

iOS-UICollectionView快速构造/拖拽重排/轮播实现

▼魔方 西西 提交于 2020-03-06 13:42:26
代码地址如下: http://www.demodashi.com/demo/11366.html 目录 UICollectionView 的定义 UICollectionView 快速构建GridView网格视图 UICollectionView 拖拽重排处理(iOS8.x-/iOS9.x+) UICollectionView 实现简单轮播 UICollectionView的定义 UICollectionView 同 UITableView 一样,是iOS中最常用到数据展示视图。 官方定义: An object that manages an ordered collection of data items and presents them using customizable layouts. 提供管理有序数据集合且可定制布局能力的对象 UICollectionView 显示内容时: 通过 dataSource 获取 cell 通过 UICollectionViewLayout 获取 layout attributes 布局属性 通过对应的 layout attributes 对 cell 进行调整,完成布局 UICollectionView 交互则是通过丰富的 delegate 方法实现 iOS10中增加了一个新的预处理protocol

Uicollection view dynamic height but fixed width

与世无争的帅哥 提交于 2020-03-05 00:23:37
问题 I am working with UICollectionView I have 4 different kind of cells. Every cell is designed in xib file . when i load them in collection view it goes out of screen. i don't know why it is happening. Some cells have fixed height while some have dynamic height (depends on data coming from API). So is there any possible way to solve this issue. i have tried Estimate size automatic to dynamic override func awakeFromNib() { super.awakeFromNib() self.contentView

XCUITest - fail to find UICollectionView Cell and cell items

徘徊边缘 提交于 2020-03-04 21:33:16
问题 i have collection list of items cell , i wants to make UI test (XCUItest). But unable to find the element collection view cell and its elements inside it . UIViewController ---> UICollectionView ----> UICollectionViewCell -----> The element that I would like to get. func testProductListingPageLoad() { let collection = app.collectionViews["ProductList"] let element = collection.cells["ProductListItemCell0"].firstMatch XCTAssert(collection.exists) // it is successful XCTAssert(element.exists) /

iOS UI控件详解—「UICollectionView综合视图」

烂漫一生 提交于 2020-03-04 11:04:17
Write in the first【写在最前】 UITableView 熟悉吧, UICollectionView 必须熟悉吧。 在 WWDC2012 中的 Introducing Collection Views ,苹果首次介绍了 UICollectionView ,类似 UITableView 的用法使人很容易接受,但强大的自定义布局,又使其相较于 UITableView 有了选择它的更多理由, UITableView 中的表格只支持单排列表,没有办法支持网格列表模式, CollectionView 有着灵活的布局特性,这一点充分说明我们在学会 UITableView 的基础上,再去学习推敲 CollectionView 的必要性。 本篇文章主要从【 UICollectionView 系统文件注解】学习总结。 在「时间 & 知识 」有限内,总结的文章难免有「未全、不足 」的地方,还望各位好友指出,以提高文章质量。 目录: UICollectionView概念 UICollectionView基本组成 UICollectionView层次结构 1.UICollectionView 继承于 UIScrollView 2.UICollectionViewDataSource数据源 3.UICollectionViewDelegate代理 4

Creating decoration view as custom column in UICollection View

南楼画角 提交于 2020-02-29 03:29:53
问题 I have a collection view that displays a seating chart and I have been able to achieve this using the collection view Flow Layout with the following code: class SeatsLayout: UICollectionViewFlowLayout { let cellsPerRow: Int override var itemSize: CGSize { get { guard let collectionView = collectionView else { return super.itemSize } let marginsAndInsets = sectionInset.left + sectionInset.right + minimumInteritemSpacing * CGFloat(cellsPerRow - 1) let itemWidth = ((collectionView.bounds.size

Screen goes black after segue

人走茶凉 提交于 2020-02-21 10:24:03
问题 I have tried to debug this but to no avail. Basically when I segue from the first view controller to the second view controller the screen goes black momentarily. The code performs as I want it to but the screen going black is a bit of a pain for me. Here is the code: The segue from the first page: func mapView(_ mapView: MGLMapView, tapOnCalloutFor annotation: MGLAnnotation) { self.performSegue(withIdentifier: "goToSecond", sender: self) } second view controller: override func viewDidLoad()

Screen goes black after segue

喜欢而已 提交于 2020-02-21 10:18:52
问题 I have tried to debug this but to no avail. Basically when I segue from the first view controller to the second view controller the screen goes black momentarily. The code performs as I want it to but the screen going black is a bit of a pain for me. Here is the code: The segue from the first page: func mapView(_ mapView: MGLMapView, tapOnCalloutFor annotation: MGLAnnotation) { self.performSegue(withIdentifier: "goToSecond", sender: self) } second view controller: override func viewDidLoad()

Screen goes black after segue

假装没事ソ 提交于 2020-02-21 10:17:05
问题 I have tried to debug this but to no avail. Basically when I segue from the first view controller to the second view controller the screen goes black momentarily. The code performs as I want it to but the screen going black is a bit of a pain for me. Here is the code: The segue from the first page: func mapView(_ mapView: MGLMapView, tapOnCalloutFor annotation: MGLAnnotation) { self.performSegue(withIdentifier: "goToSecond", sender: self) } second view controller: override func viewDidLoad()

iOS Swift: How to recreate a Photos App UICollectionView Layout

微笑、不失礼 提交于 2020-02-20 11:23:47
问题 I am wondering for quiet a while now how to create the iOS Photos App layout. How can I make it so it looks like zooming in to a collection while at the same time the navigation bar shows a back button? Is it a new view controller which gets pushed onto a UINavigationController? And if so, how exactly do they manage to match the tiles while expanding. Is there maybe even a 3rd party library which lets me easily recreate such a layout? Hope you can help me to understand the concept of how this