Fry*_*Fry 6 uinavigationbar ios
我想在iOS 10中使用与"联系人"应用程序相同的动画构建一个视图控制器.当您向下滚动页面时,联系人的照片会显示在导航栏的中间.
iOS 10中有一个API还是自定义实现?
一个技巧可能是使导航栏不可见。在情节提要中设置 Simulated Metrics -> Top Bar = None (您甚至可以避免它)。
在视图控制器中将其添加到 viewDidLoad 中:
斯威夫特3.0
navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
navigationController?.navigationBar.shadowImage = UIImage()
navigationController?.navigationBar.isTranslucent = true
Run Code Online (Sandbox Code Playgroud)
Objective-C
[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
self.navigationController.navigationBar.shadowImage = [UIImage new];
self.navigationController.navigationBar.translucent = YES;
Run Code Online (Sandbox Code Playgroud)
然后,您应该在滑动 uitableview/uiscrollview 时创建一个带有联系人详细信息的动画,这取决于您想要做什么...
编辑:在这里您可以找到模拟器上的示例...对于丑陋的模型感到抱歉:D
