diff options
author | Ryan Petrich <rpetrich@gmail.com> | 2010-09-23 00:50:46 -0600 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2010-09-30 10:42:38 +0000 |
commit | dcb47737cbcdf0d36c0c679fed1f2c451aa106a7 (patch) | |
tree | f2eb7cb884b09adc11e0983499528fe587ac4e54 /Cydia.mm | |
parent | 6b727a05d79d39a7fa5dcc6613c8f60f68035da1 (diff) |
Fix search bar rect when starting in landscape
Diffstat (limited to 'Cydia.mm')
-rw-r--r-- | Cydia.mm | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -7180,14 +7180,21 @@ freeing the view controllers on tab change */ - (id) title { return nil; } - (id) initWithDatabase:(Database *)database { - if ((self = [super initWithDatabase:database title:UCLocalize("SEARCH") filter:@selector(isUnfilteredAndSearchedForBy:) with:nil]) != nil) { - search_ = [[objc_getClass("UISearchBar") alloc] initWithFrame:CGRectMake(0, 0, [[self view] frame].size.width, 44.0f)]; + return [super initWithDatabase:database title:UCLocalize("SEARCH") filter:@selector(isUnfilteredAndSearchedForBy:) with:nil]; +} + +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + if (!search_) { + search_ = [[objc_getClass("UISearchBar") alloc] initWithFrame:CGRectMake(0, 0, [[self view] bounds].size.width, 44.0f)]; + [search_ layoutSubviews]; [search_ setPlaceholder:UCLocalize("SEARCH_EX")]; - [search_ setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight]; + UITextField *textField = [search_ searchField]; + [textField setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin]; [search_ setDelegate:self]; - [[search_ searchField] setEnablesReturnKeyAutomatically:NO]; - [[self navigationItem] setTitleView:search_]; - } return self; + [textField setEnablesReturnKeyAutomatically:NO]; + [[self navigationItem] setTitleView:textField]; + } } - (void) _reloadData { |