uicollectionview

Swift - UIButton in UICollectionViewCell not clickable

十年热恋 提交于 2019-12-24 09:24:21
问题 I currently have a UICollectionViewController to display all my news articles. For my news items, I have created a custom UICollectionViewCell with a small button in the top right corner. The problem is that it is only working when I set my feedCell to isUserInteractionEnabled = true . I only want the newsMenu button to be clickable, not have the whole cell to be selectable. How do I achieve this? override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath:

Perform a segue selection from a uicollectionview that is embedded in a tableview cell?

删除回忆录丶 提交于 2019-12-24 09:19:02
问题 Currently we have a uicollectionview that is embedded in a tableview cell. When the collection view cell is selected it's suppose to initiate a push segue to another view controller. The problem is there is no option to perform the segue on the cell. Is there a way around it? Here is the cell: class CastCell : UITableViewCell { var castPhotosArray: [CastData] = [] let extraImageReuseIdentifier = "castCollectCell" let detailToPeopleSegueIdentifier = "detailToPeopleSegue" var castID: NSNumber?

Material Ripple Effect for UICollectionView Cell

↘锁芯ラ 提交于 2019-12-24 09:07:05
问题 I am trying to create a material ripple effect for a UICollectioView cell. For Android, there are several material design options to do so, but for iOS that does not appear to be the case. Below is my custom cell I am using as the prototype to populate the UICollectioView: import UIKit class PollCell: UICollectionViewCell { @IBOutlet weak var imageView: UIImageView! @IBOutlet weak var pollQuestion: UILabel! } Where I initialize the CollectioViewCell: override func viewDidLoad() { super

UICollectionView mosaic layout

拜拜、爱过 提交于 2019-12-24 08:58:12
问题 I need to create a mosaic layout for an app. It would be wonderful to have a completely dynamic layout, similar to the one in the pic below: I'm using this library that is really cool, but allows to have only dynamic height. Is there some library out there or is there a way to achieve this result? Thank you! 来源: https://stackoverflow.com/questions/40791197/uicollectionview-mosaic-layout

How to detect when UIWebView starts loading when Webview is inside a Collection View cell?

为君一笑 提交于 2019-12-24 08:42:21
问题 I am loading a collection view of cells containing UIWebView s. There's a time gap between when my UICollectionView 's activity indicator stops spinning and the UIWebView loads. I am trying to get a reference to when the loading starts (and eventually when it stops) in order to add another activity indicator UI. I'm not sure how to do it here though since my UIWebView is in my CollectionViewCell and not my CollectionView , in other words I can't use the delegate methods and set myself as my

How do I show a UITableView within a UICollectionViewCell

时光怂恿深爱的人放手 提交于 2019-12-24 08:21:31
问题 I am a new Swift programmer and I am currently working on a very simple to-do-list application. The catch is that I want to display a not-to-do list as well. Additionally, I am attempting to do this all through code. I want the user to be able to scroll horizontally between 2 CollectionViewCells, that each have a TableView within them displaying a 'To Do List' and a 'Not To Do List'. So far I have a ViewController that creates a UICollectionView that has 2 custom cells that each fills up the

Issue with placing cells in custom flow layout of UICollectionViews

拟墨画扇 提交于 2019-12-24 07:40:06
问题 I am trying to create a tag flow layout. To do this I followed a very nice tutorial https://codentrick.com/create-a-tag-flow-layout-with-uicollectionview/ I managed to create and customize the flow layout, but the cells are not aligned properly some times. Here is the screenshot from iphone 4S. I have two header sections also As you can see in section 1, the tags are not placed correctly. I am not understanding what is causing this issue. Here is my custom flow layout class import UIKit class

Change tableView Cells by choosing different cells from collectionView which is the Header of tableview

浪子不回头ぞ 提交于 2019-12-24 07:36:24
问题 I have the collectionView as my tableview header. Now I need to change the cells of the tableView depending on the cell I choose from the collection view. How do I do this from didselect of the collectionview? This is my tableview: extension DeliveryTimeVC: UITableViewDelegate, UITableViewDataSource { func numberOfSections(in tableView: UITableView) -> Int { return 1 } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return sortedTimeFrom.count } func

Load multiple UICollectionView in UITableView in view controller Swift

…衆ロ難τιáo~ 提交于 2019-12-24 07:27:06
问题 I am building an iOS application where there are 4 different designs of the UICollectionViewn in UITableView. UICollectionViewCell Class Name are : DealCollectionViewCell, FilterCollectionViewCell, ComboCollectionViewCell, BusinessCollectionViewCell UITableViewCell Class Name are : DealTableViewCell, BusinessTableViewCell, FilterTableViewCell, ComboTableViewCell Below is UIViewController class code (Class Name HomeViewControllerr) class extend UIViewController, UITableViewDelegate,

UICollectionView clipsToBounds is not working properly with paging

[亡魂溺海] 提交于 2019-12-24 07:22:49
问题 I am using UICollectionView with horizontal paging enabled. My collectionView frame is less than the screen size. I used the following code : myCollectionView.clipsToBounds=FALSE; Still I am not able to see the views outside the bounds of my collectionView. I am using custom UICollectionViewLayout 回答1: If the size of each page is greater or equal to your collectionView 's frame size, you will not be able to see the content outside the frame even clipToBounds is disabled. In order to save the