Tuesday, April 9, 2024
HomeiOS Developmentios - Scroll Assortment centeredHorizontally Iphone SE

ios – Scroll Assortment centeredHorizontally Iphone SE


I’ve a set, which has a perform that facilities a sure part. The issue is that on the iPhone 14 Professional the part is centered, however on the iPhone SE it doesn’t middle, with the index fully on the correct. I want it to work like an iPhone with a bigger display screen.

caroulselView.collectionCarousel.reloadData()
caroulselView.collectionCarousel.layoutIfNeeded()
caroulselView.selectItemAndScroll(setIndex)
func selectItemAndScroll(_ setIndex: Int = 0 ) {
    let startIndexPath = IndexPath(row: 0, part: setIndex)
    collectionCarousel.selectItem(at: startIndexPath, animated: true, scrollPosition: .centeredHorizontally)
}

Iphone SE
Iphone 14

Presently my assortment has 11 indexes and I all the time wish to begin with my eighth place. Is there any method to make this work on iPhone SE too?



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments