summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Petrich <rpetrich@gmail.com>2010-09-23 00:50:46 -0600
committerJay Freeman (saurik) <saurik@saurik.com>2010-09-30 10:42:38 +0000
commitdcb47737cbcdf0d36c0c679fed1f2c451aa106a7 (patch)
treef2eb7cb884b09adc11e0983499528fe587ac4e54
parent6b727a05d79d39a7fa5dcc6613c8f60f68035da1 (diff)
Fix search bar rect when starting in landscape
-rw-r--r--Cydia.mm19
1 files changed, 13 insertions, 6 deletions
diff --git a/Cydia.mm b/Cydia.mm
index f94b9de..6587769 100644
--- a/Cydia.mm
+++ b/Cydia.mm
@@ -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 {