UISearchDisplayController就像在ios7日历app [英] UISearchDisplayController like in ios 7 calendar app

查看:87
本文介绍了UISearchDisplayController就像在ios7日历app的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何实现:我有带搜索图标的UIBarButtonItem,点击它后,我想在导航栏中显示搜索栏,点击搜索栏中的取消按钮,我想显示导航栏没有搜索和按钮和标题,如IOS 7日历应用程序。

How to implement: I have UIBarButtonItem with search icon, after click on it, I want to show search bar in navigation bar and on click cancel button in search bar, I want to show navigation bar without search and with buttons and title like in IOS 7 calendar app.

推荐答案

来自苹果文档:

在iOS 7中,UISearchDisplayController包含displaysSearchBarInNavigationBar属性,您可以使用该属性将搜索栏放在导航栏中,类似于iPhone上的日历中的搜索栏:

In iOS 7, UISearchDisplayController includes the displaysSearchBarInNavigationBar property, which you can use to put a search bar in a navigation bar, similar to the one in Calendar on iPhone:

https://developer.apple .com / library / ios / documentation / userexperience / conceptual / TransitionGuide / Bars.html

这篇关于UISearchDisplayController就像在ios7日历app的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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