uicollectionviewlayout

iOS UICollectionView Horizontal Scrolling Rectangular Layout with different size of items?

别说谁变了你拦得住时间么 提交于 2020-07-09 11:57:46
问题 iOS UICollectionView how to Create Horizontal Scrolling rectangular layout with different size of items inside. I want to create a Rectangular layout using UICollectionView like below. how can i achieve? When i scroll horizontally using CollectionView 1,2,3,4,5,6 grid will scroll together to bring 7. The Below are the dimensions of 320*480 iPhone Resolution. Updated Screen below. First 6 items have below dimensions for iPhone 5s. Item 1 Size is - (213*148) Item 2 Size is - (106*75) Item 3

How do I change the horizontal spacing between cells in a horizontal scroll collection view

戏子无情 提交于 2020-06-01 07:37:06
问题 I have a collection view which is basically a horizontal table view. It's one line of cells that scrolls left and right. Sort of like a carousel without the fancy animation. I would like to be able to control the distance between cells. There is a property for doing that in the interface builde. It is in the collection view flow layout, in the inspector (in the tab with the little ruler where you usually see constraints). It is called Min. Spacing and has two variants: For Cells and For Lines

UICollectionViewCompositionalLayout: control number of items in a group with fractional group width

馋奶兔 提交于 2020-05-14 03:35:09
问题 Using UICollectionViewCompositionalLayout , I'd like to render a specific number of items in one group and a specific number of items in another group This is a simplified version of the layout I came up with: func createTestSectionLayout(noTextItems: Int, noImageItems: Int) -> NSCollectionLayoutSection { // noTextItems texts can have different lengths let textItemSize = NSCollectionLayoutSize(widthDimension: .estimated(80), heightDimension: .estimated(44)) var textItems =

UICollectionViewLayout Not working with UIImage in Swift 5 and Xcode 11

雨燕双飞 提交于 2020-04-07 08:21:11
问题 Please check this attached code and screen short. It's work fine when I set the color of container view but when I add UIImage in cell then it's not working. I changed the imageview content mode but it's not working. class ViewController: UIViewController { @IBOutlet weak var segColumn: UISegmentedControl! @IBOutlet weak var collectionView: UICollectionView! fileprivate var items: [UIImage] = [ // My images ] override func viewDidLoad() { super.viewDidLoad() self.setup() } } extension

UICollectionView last cell not aligned

不问归期 提交于 2020-01-23 07:54:05
问题 I am new to iOS and I now have an issue. My goal is to get a sliding bar with filtering buttons on it. I have a UICollectionView as a subview in some other view all is displaying well except for the last cell. Here is the delegate and datesource of the uicollectionview class PmtCategoryCollectionViewController: UICollectionViewController { var categories = ["Mediterranean", "Italian", "French", "Chinese", "American", "Indian"] var buttonDistanceToEachOther: CGSize = CGSize(width: 20, height:

Animate UICollectionView cell size change and reposition surrounding cells

前提是你 提交于 2020-01-22 05:46:20
问题 Goal: To animate the change of a cell's height and reposition surrounding cells. Scenario: Some cells in a collection view load remote images. Initially, those cells are sized statically and an activity indicator is shown. After an image is loaded, it is added to its cell and the cell's height is changed to fit the photo. Notes: I am animating the cell's frame change with animateWithDuration . This works fine, except an increased cell size has it overlapping the cells below. I've blindly

How to expand collectionview cell to full screen [closed]

本秂侑毒 提交于 2020-01-21 07:48:45
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I created a horizontal collection view and single cell is displayed in screen. I try to preview another views in each cell and when user swipe up the cell should expand to full screen. I don't know to how to approach this problem? How can I expand cell to fullscreen animated? 回答1: If you want to increase cell

UICollectionview footer in swift

限于喜欢 提交于 2020-01-17 04:58:10
问题 I want to add footer to a UICollectionView using this code. i am using Using Custom Layout in UICollectionView layout Added delegate and datasource methods :- UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout Code in viewdDidLoad() function :- UINib(nibName: "ProfileFooter", bundle:nil) collectionView!.registerNib(nibName1, forSupplementaryViewOfKind: UICollectionElementKindSectionFooter, withReuseIdentifier: "ProfileFooter") collectionView.registerClass