SDVRY
SDVRY

Reputation: 13

Search bar added in navigation titleView

  1. Search bar as a navigationitem titleView on first view controller.

2.while clicking search button on keypad Pushing the second view controller

issue: after pushing the some black line is moving from right side to left side in second view controller.. please check the attached images for better understanding

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

 UIViewController *detail = [self.storyboard instantiateViewControllerWithIdentifier:@"SearchDetailViewController"];
[self.navigationController pushViewController:detail animated:YES];
}

FirstViewController

Second View controller

Upvotes: 1

Views: 118

Answers (1)

Sheereen S
Sheereen S

Reputation: 1236

I faced the same issue.You should dismiss searchbar keyboard before push.

[self.searchBar resignFirstResponder];

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
[self.searchBar resignFirstResponder];

UIViewController *detail = [self.storyboard instantiateViewControllerWithIdentifier:@"SearchDetailViewController"];
[self.navigationController pushViewController:detail animated:YES];
}

Upvotes: 0

Related Questions