将表视图放在导航栏下
Place TableView under NavigationBar
首先,我在 UINavigationController
中有一个 UITableViewController
,我通过将 BackgroundImage 设置为空图像使 UINavigationBar
透明。
现在我希望 TableView 在 NavigationBar 下启动。我已经尝试将 automaticallyAdjustsScrollViewInsets
设置为 false
并将 edgesForExtendedLayout
设置为全部。
我正在使用 Xcode 9 Beta。
尝试self.tableView.contentInset= UIEdgeInsetsMake(-64, 0, 0, 0);
在导航栏下方启动它
更新:
要更改滚动指示器,您必须这样设置:
self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(-64, 0, 0, 0);
首先,我在 UINavigationController
中有一个 UITableViewController
,我通过将 BackgroundImage 设置为空图像使 UINavigationBar
透明。
现在我希望 TableView 在 NavigationBar 下启动。我已经尝试将 automaticallyAdjustsScrollViewInsets
设置为 false
并将 edgesForExtendedLayout
设置为全部。
我正在使用 Xcode 9 Beta。
尝试self.tableView.contentInset= UIEdgeInsetsMake(-64, 0, 0, 0);
在导航栏下方启动它
更新:
要更改滚动指示器,您必须这样设置:
self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(-64, 0, 0, 0);