Open gerryats opened 6 years ago
Rewrite func reloadData()
, Set scrollView. contentInset
based on the frame value of titleLabels.last
I was unsuccessful in centering content with the above instructions. What I tried:
// Center
if let lastFrame = titleLabels.last?.frame {
scrollView.contentInset = UIEdgeInsetsMake(lastFrame.origin.x,
lastFrame.origin.y,
lastFrame.height,
lastFrame.width)
}
How can I move segments to horizontal center of screen. Suppose if their are 2 segments only?