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 :: this love taylor swift 
Swift :: gap between table header uitableview 
Swift :: pushviewcontroller swift autolayout 
Swift :: localized string format swift 
Swift :: textfield style swiftui own 
Swift :: swift uiswitch change size 
Swift :: button sizetofit not working swift 
Swift :: switches xcode 
Swift :: swift access appdelegate from viewcontroller 
Swift :: fetch codable from userdefaults ios swift 
Swift :: swift uiview gradient 
Swift :: how do i get a string from a float swift to 1 decimal swift 
Swift :: swift button 
Swift :: IOS create UIAlertViewController programmatically 
Swift :: swift ui enum 
Swift :: swift url request 
Swift :: closure swift 
Swift :: change font swiftui 
Swift :: swift string time to epoch 
Swift :: add shadow to specific corner of UIView with shadow swift 6 site:stackoverflow.com 
Swift :: objective c vs swift 
Swift :: swiftui tabview background color 
Swift :: Swift Bitwise AND Operator 
Swift :: swift int max 
Swift :: swift view 
Swift :: Modifying Value Types from Method Swift 
Swift :: abs swift 
Swift :: Swift enum With Switch Statement 
Swift :: Button on right side/view of UITextField 
Swift :: how to switch tabs in xcode 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =