문제

enter image description here enter image description here

I have a tableviewcontroller with a button, textfield, and a search bar display controller in the header view of the tableview.

When I click on the searchbar, then on either cancel or the background tableview(to dismiss it), the search bar will re size to cover the entire view it was in(over the button and text field).

In viewDidLoad I have

self.searchBar.translatesAutoresizingMaskIntoConstraints = YES;

http://i479.photobucket.com/albums/rr152/nebulouslove/photo.png

Any ideas please?

도움이 되었습니까?

해결책

Just add height and width constraints to the search bar and pin it to top, left, and right.

You can do that here:

here:

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top