iOS 7 Custom TableView Is Under TabBar

后端 未结 16 1665
萌比男神i
萌比男神i 2020-12-13 04:31

Im trying port my app to iOS7, but my custom TableViewController is showing the last row (cell) under the TabBar :(

Im searchi

16条回答
  •  感动是毒
    2020-12-13 05:07

    I had a similar problem with collection view. Changing the collection view frame and content inset below fixed it for me...

        guard let cv = collectionView,
            let tabBar = tabBarController?.tabBar else { return }
    
        // Resize collection view for tab bar
        let adjustedFrame = CGRect(origin: cv.frame.origin,
                                   size: CGSize(width: cv.frame.width, height: cv.frame.height - tabBar.frame.height))
        cv.frame = adjustedFrame
    
        // Adjust content inset for tab bar
        let adjustedContentInsets = UIEdgeInsetsMake(0, 0, tabBar.frame.height, 0)
        cv.contentInset = adjustedContentInsets
        cv.scrollIndicatorInsets = adjustedContentInsets
    

    Good luck!

提交回复
热议问题