UISearchBar height on iOS8 when showsScopeBar=YES

后端 未结 4 987
不思量自难忘°
不思量自难忘° 2020-12-29 10:53

I\'m using UISearchBar in my app, with showsScopeBar=YES. When running under iOS8 (both in the simulator and on a device) the scope bar is hidden a

4条回答
  •  攒了一身酷
    2020-12-29 11:25

    I ran into this problem too. After searching on Apples developer forum I found this thread: https://devforums.apple.com/thread/235803?start=0&tstart=0

    And apparently the SearchBar don't automatically does a sizeToFit when it's supposed too. So it's height stays at 44 instead of adjusting to the scope buttons. The bug is not fixed in the iOS8 GM.

    I did a simple [self.searchBar sizeToFit] in my viewWillAppear: and that solved it.

提交回复
热议问题