0

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.

patel kavit
  • 484
  • 1
  • 6
  • 22

2 Answers2

1

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.

Suryakant Sharma
  • 3,852
  • 1
  • 25
  • 47
0

Issue has been fixed now by subclassing the UISearchBar and overriding the layoutSubviews method to find the search text field and assign the rightView of text field.

patel kavit
  • 484
  • 1
  • 6
  • 22