iOS7的UISearchBar问题 [英] UISearchBar issue with iOS7

查看:46
本文介绍了iOS7的UISearchBar问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在UISearchBar的搜索文本字段的右侧添加了一个附件视图.我们已经使用基本的SDK iOS 6开发了我们的应用程序,在iOS 6中一切正常,但是当我们在iOS 7上安装相同的应用程序时,搜索文本字段的右侧附件视图未显示.

We have added an accessory view on right side of the search text field of UISearchBar. We have developed our app with base SDK iOS 6, in iOS 6 all thing works well, but when we install the same app on iOS 7, the right accessory view of search text field is not being shown.

请让我知道我们如何解决这个问题.

Please let me know how can we can resolve this.

谢谢.

推荐答案

是某些组件,例如 iOS 6 UISwitch accessory 视图>如果您在界面"构建器中通过 n-drop 拖放使用了这些UI组件,则在 iOS 7 反之亦然中将不可见

Yes some of the component like UISwitch, accessory view of iOS 6 won't be visible in iOS 7 and vise-versa, if you use those UI component by drag-n-drop in Interface builder.

有以下三种方法可以在 iOS 7&中正确使用UI组件:iOS 6 和以前的版本

Here is three ways to use UI Component properly in iOS 7 & iOS 6 and previous version

  1. 以编程方式创建此类组件并正确设置框架,然后将这些视图作为子视图添加到主视图中,并在任何版本的iOS中顺利运行应用程序.

  1. Create such component programmatically and set the frame properly and add those view into main view as subview and run app in any version of iOS smoothly.

iOS 6 及其以下版本创建两个单独的项目.适用于 iOS 7 和更高版本.

Create two separate projects for iOS 6 and below & for iOS 7 and later.

第三个是第一个的扩展,将您的项目升级到 iOS7 ,并在同一版本中构建它,然后在 iOS 6 及以下版本中运行它,您将填充一些UI组件以使其无法正确对齐,通过设置框架手动对齐那些UI组件,并且还可能会发现一些UI组件不可见,因此请按照第一点做.以编程方式创建这些UI组件.

And the third is extension of first one , upgrade your project into iOS7 and build it in the same and run it in the iOS 6 and below, you will fill some UI component to not properly aligned, align those manually by setting frame and also you may find some UI component invisible, so do as first point says. create those UI component programmatically.

这篇关于iOS7的UISearchBar问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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