Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
273 views
in Technique[技术] by (71.8m points)

ios - UISearchBar issue with iOS7

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.

Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

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

  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.

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

  3. 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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...