Can't get scrollsToTop working on iOS7

前端 未结 6 441
我在风中等你
我在风中等你 2020-12-29 04:15

I\'m targeting iOS7 in my latest app, and tapping on the status bar doesn\'t seem to scroll a tableView or collectionView to the top.

I\'ve set self.tableView.

6条回答
  •  自闭症患者
    2020-12-29 04:57

    The short answer is there's nothing different in iOS7. As long as there isn't more than one UIScrollView loaded, your tableView or collectionView will scroll to the top when the user taps the status bar. The key here is loaded; another scrollView doesn't necessarily have to be on screen to conflict with another scrollView that is.

    Sliding drawers in the left/right are very popular these days, and this was the reason for my problem. I have a menu containing my navigation options, and these are all held by a UITableView. I had to make sure that I set menuTable.scrollsToTop = false before I could get things working in the other parts of my app.

提交回复
热议问题