首页 > tableview scroll到bottom时,cell有时候会遮挡住一部分

tableview scroll到bottom时,cell有时候会遮挡住一部分

RT, 我是这么设置的, 但如图所示,有时候回遮挡住cell的内容, 有时候不会

 self.tableView.scrollToRowAtIndexPath(NSIndexPath(forRow: self.messages().count-1, inSection: 0), atScrollPosition: UITableViewScrollPosition.Bottom, animated: false)
 
 

http://stackoverflow.com/questions/25686490/ios-8-auto-cell-height-cant-scroll-to-last-row 和这个问题类似


self.automaticallyAdjustsScrollViewInsets = NO;
加上这句看看


我用了http://stackoverflow.com/questions/25686490/ios-8-auto-cell-height-cant-scroll-to-last-row 中说的这个方法 就解决了, 但不知道为什么, 谁能解释一下?

 if array.count > 0 {
        let indexPath: NSIndexPath = NSIndexPath(forRow: array.count - 1, inSection: 0)
        self.tblView.scrollToRowAtIndexPath(indexPath, atScrollPosition: .Bottom, animated: true)
        let delay = 0.1 * Double(NSEC_PER_SEC)
        let time = dispatch_time(DISPATCH_TIME_NOW, Int64(delay))

        dispatch_after(time, dispatch_get_main_queue(), {
            self.tblView.scrollToRowAtIndexPath(indexPath, atScrollPosition: .Bottom, animated: true)
        })
    }

你的frame的高度过高 设置下frame或者设置约束 位置在哪个输入框之上就行了

iOS有问必答社区为你回答
426981364
有问题可以扣群上问

【热门文章】
【热门文章】