开发者

UISearchDisplayController showing white instead of gray table cell borders

开发者 https://www.devze.com 2023-01-28 23:20 出处:网络
I came across this issue a long time ago, and fixed it, but now I have no clue how I did it, and I\'m coming across it in another controller.

I came across this issue a long time ago, and fixed it, but now I have no clue how I did it, and I'm coming across it in another controller.

I am using the following code to make the keyboard automatically show up when I show my view that as a search bar:

[self.rootController.changeClientViewController.searchDisplayController.searchBar becomeFirstResponder];
[self.rootController.changeClientViewController.searchDisplayController setActive:YES];

The keyboard pops up, like it should, but the lines in between each table cell are white, instead of dark-grey, and it looks bad. I am using the same code in another开发者_运维知识库 place to automatically pop up the keyboard; and there the lines are dark-grey as expected. Has anyone come across this? I could link to a screenshot if it would be helpful...


Here's one way to fix it: becomeFirstResponder after a minuscule delay, i.e.

[self.rootController.changeClientViewController.searchDisplayController.searchBar
    performSelector:@selector(becomeFirstResponder) withObject:nil afterDelay:0.0];
0

精彩评论

暂无评论...
验证码 换一张
取 消