uicollectionview

Table view inside of a collection view

徘徊边缘 提交于 2021-02-20 04:33:07
问题 I have a collection view, and each collection view cell will have a table view which will have different data for each collection view cell. The collection view is done using a storyboard and works fine, but I can not seem to get a UITableView to work inside of it. The Collection view code is below and any help is appreciated. Ideally a technique that allows me to use storyboard to customise the tableview cell, and I am using Swift 4. extension StoryboardViewController:

UICollectionView Cell Shadow

孤者浪人 提交于 2021-02-17 19:47:10
问题 I am trying to add shadow to my custom UICollectionViewCell , This is the code I am using in my custom collection view cell class: self.layer.shadowOffset = CGSizeMake(1, 0); self.layer.shadowColor = [[UIColor blackColor] CGColor]; self.layer.shadowRadius = 5; self.layer.shadowOpacity = .25; This is giving shadow to the components of the collection view cell. 回答1: Don't forget to add these 2 lines self.clipsToBounds = false self.layer.masksToBounds = false 回答2: Swift 4.2 and xcode 10 here's

UICollectionView Cell Shadow

狂风中的少年 提交于 2021-02-17 19:45:08
问题 I am trying to add shadow to my custom UICollectionViewCell , This is the code I am using in my custom collection view cell class: self.layer.shadowOffset = CGSizeMake(1, 0); self.layer.shadowColor = [[UIColor blackColor] CGColor]; self.layer.shadowRadius = 5; self.layer.shadowOpacity = .25; This is giving shadow to the components of the collection view cell. 回答1: Don't forget to add these 2 lines self.clipsToBounds = false self.layer.masksToBounds = false 回答2: Swift 4.2 and xcode 10 here's

Collection View layout bug when selectItem (Swift 5)

杀马特。学长 韩版系。学妹 提交于 2021-02-17 01:52:51
问题 After selecting cell from viewDidLoad Layout is change Before select cell After select cell let indexPath = IndexPath(row: SelectedFolderIndex, section: 0) collectionView.selectItem(at: indexPath, animated: false, scrollPosition: .centeredVertically) Layout func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { return CGSize(width: collectionView.frame.width/2.2, height: 55) } ViewDidLoad let

Outlets cannot be connected to repeating content in CollectionView Cells

痴心易碎 提交于 2021-02-16 15:09:45
问题 When I am trying to connect a UILabel in a UICollectionViewCell that has been declared as @property (nonatomic, weak) IBOutlet UILabel *Title; It shows that: Outlet cannot be connected to repeating content. I have done some search and find out that I need to use some kinds of connection of the outlet between UIView and the UICollectionView. But I do not understand what to do exactly. So how could I make such a connection so that UILabel in the UICollectionViewCell can be accessed? 回答1: You

Outlets cannot be connected to repeating content in CollectionView Cells

不问归期 提交于 2021-02-16 15:08:19
问题 When I am trying to connect a UILabel in a UICollectionViewCell that has been declared as @property (nonatomic, weak) IBOutlet UILabel *Title; It shows that: Outlet cannot be connected to repeating content. I have done some search and find out that I need to use some kinds of connection of the outlet between UIView and the UICollectionView. But I do not understand what to do exactly. So how could I make such a connection so that UILabel in the UICollectionViewCell can be accessed? 回答1: You

Xamarin Forms: How to Change the textcolor of Collectionview SelectedItem?

对着背影说爱祢 提交于 2021-02-11 13:59:50
问题 I have a CarouselPage having 5 children and every child has a horizontal collection view. When selecting an item in Collectionview or swiping the pages, I need to give a different text color and need to add an underline for the selected item. I have tried like below: CarouselHomePage.cs public partial class CarouselHomePage : CarouselPage { public List<Activity> activityList { get; set; } public CarouselHomePage() { InitializeComponent(); activityList = new List<Activity>(); AddActivities();

Xamarin Forms: How to Change the textcolor of Collectionview SelectedItem?

怎甘沉沦 提交于 2021-02-11 13:57:40
问题 I have a CarouselPage having 5 children and every child has a horizontal collection view. When selecting an item in Collectionview or swiping the pages, I need to give a different text color and need to add an underline for the selected item. I have tried like below: CarouselHomePage.cs public partial class CarouselHomePage : CarouselPage { public List<Activity> activityList { get; set; } public CarouselHomePage() { InitializeComponent(); activityList = new List<Activity>(); AddActivities();

Self-sizing UICollectionView with UITableView with dynamic header as a cell

六眼飞鱼酱① 提交于 2021-02-11 13:07:41
问题 I have a problem with making a self sizing UICollectionView with a cell that contains UITableView with a header that has a label with dynamic height. Can someone point me out to what I need to change in the attached sample project? You can see on the screenshot that the table does not fit the view as the cell's height is currently manually set. import UIKit class ViewController: UIViewController { static let section1 = "section1" static let section2 = "section2" private weak var

Self-sizing UICollectionView with UITableView with dynamic header as a cell

ε祈祈猫儿з 提交于 2021-02-11 13:05:38
问题 I have a problem with making a self sizing UICollectionView with a cell that contains UITableView with a header that has a label with dynamic height. Can someone point me out to what I need to change in the attached sample project? You can see on the screenshot that the table does not fit the view as the cell's height is currently manually set. import UIKit class ViewController: UIViewController { static let section1 = "section1" static let section2 = "section2" private weak var