滚动时收缩大标题(不是UITableViewController)iOS 11 [英] Shrink large title when scrolling (not UITableViewController) iOS 11

查看:114
本文介绍了滚动时收缩大标题(不是UITableViewController)iOS 11的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在导航控制器中嵌入了一个View Controller,并希望将大标题选项设置为true;在视图控制器内部有一个滚动视图。

I got a View Controller embedded in a Navigation Controller with prefers large titles option set to true; inside the View Controller there’s a Scroll View.

我想在滚动时缩小导航栏。

I want to make the nav bar shrink when scrolling.

我如何存档?

XCode 9,Swift 4,iOS 11

推荐答案

我还没有实现它使用UIScrollView,但我存档它可以与其他ViewControllers一起使用UITableView作为第一个视图。

I have not achieved that it works using a UIScrollView but I archived that it works with other ViewControllers using a UITableView as first view.

如果tableView不是第一个视图,则大标题无法自动隐藏。您很可能需要确保tableView是主视图的子视图数组中的第一个元素。

If the tableView is not the first view, the large title fails to hide automatically. You most likely need to make sure your tableView is the first element in the main view’s subviews array.

我希望这能解决你的问题。

I hope that this solves your problem.

这篇关于滚动时收缩大标题(不是UITableViewController)iOS 11的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆