uicollectionview

Auto-sizing UICollectionView headers

偶尔善良 提交于 2020-01-12 19:31:35
问题 I'm trying to make a detail screen for a to-do list kind of app. Here's what the detail screen currently looks like: This is a UICollectionViewController , with a header. The header contains 2 UILabel objects, and a UITextView object. The layout of these objects is managed by a vertical UIStackView . A UIView is used to set a white background. I'm having some difficulties in defining the height of this UICollectionReusableView at runtime. Any advice is appreciated. 回答1: This is a bit of a

android table with more than one column like iOS collectionView

混江龙づ霸主 提交于 2020-01-12 14:49:42
问题 is there a custom UI element on android that will behave like iOS collection view? [like a grid view, that is scrollable] or do I have to make a custom table layout custom cells that behave like columns? here a shot of a UICollectionView for iOS is there an example for this? thanks! 回答1: I don't know the collection view in iOS, but I guess TableLayout is what you are looking for. https://developer.android.com/reference/android/widget/TableLayout.html In API14+ there is GridLayout as well.

Cell of UICollectionView not always refreshed after a scroll

一曲冷凌霜 提交于 2020-01-12 06:51:30
问题 I have defined in my Storyboard (iPad) a view that contains a UICollectionView , at the bottom of the view there's also a UIToolbar . In the UICollectionView I have added a UICollectionViewCell (implemented by an iPadCellCollectionViewCell class) that contains a another view that is a Core-Plot Graph (a CPTGraphHostingView class). I have a class called X that implements the UICollectionViewDelegate and UICollectionViewDataSource . In the class X, I build for each cell of my view (in

How do I got Multiple Selections in UICollection View using Swift 4

▼魔方 西西 提交于 2020-01-12 06:21:09
问题 I'm new to swift and building iOS Application from the scratch (using swift 4) and want to do something like below. 1. Implement Multiple cell selections in UICollectionView, 2. Pass selected cells data to Server. Please anyone can help me, how to do that? Tell me the process and supporting articles to do that. Below is reference Image. Thanks in Advance. 回答1: This basic example. You can change as per your data. When you select any cell then you need to check that selected cell is already

UICollectionView contentOffset changes with custom layout

妖精的绣舞 提交于 2020-01-12 04:20:07
问题 I have a UICollectionView with a custom UICollectionViewLayout (actually, I'm using this nice layout). I set contentOffset = CGPointZero in viewDidLoad. After viewDidLoad, however, the offset is -20, and the content gets pushed down like so: (It should be flush with the line). I'm loading the collection view layout in interface builder. It seems that my problem is very similar to this one, however the solutions there don't work for me. I tried modifying collectionViewContentSize in my layout

iOS开发 适配iOS10

一曲冷凌霜 提交于 2020-01-11 21:08:24
2016年9月7日,苹果发布iOS 10。2016年9月14日,全新的操作系统iOS 10将正式上线。 作为开发者,如何适配iOS10呢? 1.Notification(通知) 自从 Notification 被引入之后,苹果就不断的更新优化,但这些更新优化只是小打小闹,直至现在iOS 10开始真正的进行大改重构,这让开发者也体会到 UserNotifications 的易用,功能也变得非常强大。 iOS 9 以前的通知 1.在调用方法时,有些方法让人很难区分,容易写错方法,这让开发者有时候很苦恼。 2.应用在运行时和非运行时捕获通知的路径还不一致。 3.应用在前台时,是无法直接显示远程通知,还需要进一步处理。 4.已经发出的通知是不能更新的,内容发出时是不能改变的,并且只有简单文本展示方式,扩展性根本不是很好。 iOS 10 开始的通知 1.所有相关通知被统一到了 UserNotifications.framework 框架 中。 2.增加了撤销、更新、中途还可以修改通知的内容。 3.通知不在是简单的文本了,可以加入视频、图片,自定义通知的展示等等。 4.iOS 10相对之前的通知来说更加好用易于管理,并且进行了大规模优化,对于开发者来说是一件好事。 5.iOS 10开始对于权限问题进行了优化,申请权限就比较简单了(本地与远程通知集成在一个方法中)。    如果使用了推送

UICollectionView drag finger over cells to select them

◇◆丶佛笑我妖孽 提交于 2020-01-11 20:00:54
问题 Using UICollectionView , is it possible to select multiple cells by dragging your finger over a few of them? E.g., if you drag your finger over a row of 6, and down into the next row, it would select all of them. Tried something simple: UISwipeGestureRecognizer *swipeGuesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeGesture:)]; [self.collectionView addGestureRecognizer:swipeGuesture]; But that seemed to only call the method on the first cell that was

Subview frame is incorrect when creating UICollectionViewCell

坚强是说给别人听的谎言 提交于 2020-01-11 18:50:53
问题 The problem I created a UICollectionViewController with a custom UICollectionViewCell. The custom cell contains a large and rectangular UIView (named colorView) and a UILabel (named nameLabel). When the collection is first populated with its cells and I print colorView.frame, the printed frames have incorrect values. I know they are incorrect, because the colorView frames are larger than the cell frame themselves, even though the colorView gets drawn correctly. However, if I scroll the

Subview frame is incorrect when creating UICollectionViewCell

試著忘記壹切 提交于 2020-01-11 18:48:44
问题 The problem I created a UICollectionViewController with a custom UICollectionViewCell. The custom cell contains a large and rectangular UIView (named colorView) and a UILabel (named nameLabel). When the collection is first populated with its cells and I print colorView.frame, the printed frames have incorrect values. I know they are incorrect, because the colorView frames are larger than the cell frame themselves, even though the colorView gets drawn correctly. However, if I scroll the

Scrolling in UICollectionView selects wrongs cells - Swift

我只是一个虾纸丫 提交于 2020-01-11 05:36:05
问题 I have the following UICollectionView which is populated by an Array with NSManagedObject of type Categories The problem is that when a Cell is selected scrolling does not function correctly. When scrolling through the UICollectionView other cells get selected, and deselected. Strange behaviour. I think this is because of the indexPath that is set incorrectly after scrolling? Anyway, I have been struggling with this for a couple of hours, and cannot seem to grasp it. Hopefully someone can