Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

swift collection view cell size

extension YourViewController: UICollectionViewDelegateFlowLayout {
    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
        return CGSize(width: screenWidth, height: screenWidth)
    }
}
Comment

collectionview cellssize swift 4

//Use for size
func collectionView(collectionView: UICollectionView,
        layout collectionViewLayout: UICollectionViewLayout,
        sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {

    }
//Use for interspacing
    func collectionView(collectionView: UICollectionView,
        layout collectionViewLayout: UICollectionViewLayout,
        minimumInteritemSpacingForSectionAtIndex section: Int) -> CGFloat {
            return 1.0
    }

    func collectionView(collectionView: UICollectionView, layout
        collectionViewLayout: UICollectionViewLayout,
        minimumLineSpacingForSectionAtIndex section: Int) -> CGFloat {
            return 1.0
    }
Comment

collectionview cellssize swift 4

extension MyClass: UICollectionViewDelegateFlowLayout { 
        func collectionView(_ collectionView: UICollectionView,
                            layout collectionViewLayout: UICollectionViewLayout,
                            sizeForItemAt indexPath: IndexPath) -> CGSize {

        }

        func collectionView(_ collectionView: UICollectionView,
                            layout collectionViewLayout: UICollectionViewLayout,
                            minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
            return 1.0
        }

        func collectionView(_ collectionView: UICollectionView, layout
            collectionViewLayout: UICollectionViewLayout,
                            minimumLineSpacingForSectionAt section: Int) -> CGFloat {
            return 1.0
        }
    }
Comment

PREVIOUS NEXT
Code Example
Swift :: add shadow to specific corner of UIView with shadow swift 6 site:stackoverflow.com 
Swift :: swift get slected row data in tableview cell 
Swift :: how to set the font of text in swiftui 
Swift :: swift pdf thumbnail 
Swift :: average in array swift 
Swift :: if else if and else statments in swift language 
Swift :: string interpolation swift 5 
Swift :: record permission swift 4 
Swift :: Swift Nested function 
Swift :: swift uilabel dynamic height based on text length 
Swift :: How to convert String into Array of character 
Swift :: Swift for-in Loop 
Swift :: enum in swift 
Swift :: swift uilabel font bold 
Swift :: two value sum 
Swift :: swift pass any closer to the function 
Swift :: Swift enums with rawValue 
Swift :: Swift Print Variables and Literals 
Swift :: auto layout issue in tableview 
Swift :: Swift Raw Values VS Associated Values 
Swift :: rust How to pass out parameter to function from Swift FFI 
Swift :: disable trailing swipe action swift 
Swift :: Function Return Types in swift 
Swift :: swift closures 
Swift :: caseiterable swift 
Swift :: xcode enable a button after a text field is filled 
Swift :: swift uicollectionview reloaddata completion 
Ruby :: turn an array of string into integer in ruby 
Ruby :: ruby temporary files 
Ruby :: if contains ruby 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =