iphone - search bar and table views are not fitting to the screen in land scape mode -
I am creating a search bar and table view program using the following code
UISearchBar * Searchbar = [[UISAxchangebar Alok] InitWith Frame: CGRactMake (0,0,320,40)]; SearchBar.delegate = self; [Self.view addSubview: searchBar]; UITableView * tblView = [[UITableView alloc] initWithFrame: CGRectMake (0, 41, 320, 400)]; TblView.delegate = self; TblView.dataSource = self; [Self.view addSubview: tblView]; Now I have returned the return value in the following method to rotate the screen readet device orientation
- (BOOL) should be used .UrototettoInterfaceArrayation: (UINPreference Orientation) Interface Orientation {Return Yes; } and I've used the following code in loadView in self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth. UIViewAutoresizingFlexibleHeight; The following is my output
You have asked to change the size of the view, but you have not asked to change the way you created the search bar again:
searchbar.autorezingMask = UIViewAutoresizingFlexibleWidth; Do this for table view.
See if you find the result you are looking for. If that does not work then you can resize the search bar and frame the size of the table view after rotation.
Comments
Post a Comment