You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i have replaced the contenview in the example with my own viewCotrollers
it works fine when the app loads and i change the tabs but when i click on the menu items the screen width is wrong and it does not scroll to the end!
it works fine on iphone xs but in larger screen sizes like iphone xs
plus or ipad the size is wrong when the menu is clicked
when i change
self?.scrollView.frame.width
to
UIScreen.main.bounds.width
it makes the tab size better but with a padding on the sides
may be you did this in viewDidLoad(), try viewDidAppear()
hi
i moved the code from viewwillappear to viewDidAppear
but still the same problem in containerVc(exampleViewController)
maybe it's a constraint problem
there is a problem with contentOffsetX!
Report
i have replaced the contenview in the example with my own viewCotrollers
it works fine when the app loads and i change the tabs but when i click on the menu items
the screen width is wrong and it does not scroll to the end!
it works fine on iphone xs but in larger screen sizes like iphone xs
plus or ipad the size is wrong when the menu is clicked
when i change
self?.scrollView.frame.width
to
UIScreen.main.bounds.width
it makes the tab size better but with a padding on the sides
segmentioView.valueDidChange = { [weak self] _, segmentIndex in let contentOffsetX = UIScreen.main.bounds.width * CGFloat(segmentIndex) changed:",self!.segmentioView.selectedSegmentioIndex) self?.scrollView.setContentOffset( CGPoint(x: contentOffsetX, y: 0), animated: true ) segmentioView.valueDidChange = { [weak self] _, segmentIndex in let contentOffsetX = UIScreen.main.bounds.width * CGFloat(segmentIndex) self?.scrollView.setContentOffset( CGPoint(x: contentOffsetX, y: 0), animated: true )
The text was updated successfully, but these errors were encountered: