diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2011-03-21 04:59:36 -0700 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2011-03-21 04:59:36 -0700 |
commit | 39470a3a0d05f4e2ecd50ee42ed81124326a51e1 (patch) | |
tree | 7f07c12b210f9b56386536eacae3c1248094285e /MobileCydia.mm | |
parent | 9256a1ce33a4102a678fe087f072edcc0c0b7b02 (diff) |
Use autoresizingMask for base UIViewController views.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r-- | MobileCydia.mm | 55 |
1 files changed, 36 insertions, 19 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index face09b..46d77c0 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -5776,14 +5776,16 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } - (void) loadView { - [self setView:[[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]]; + UIView *view([[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]); + [view setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; + [self setView:view]; list_ = [[[UITableView alloc] initWithFrame:[[self view] bounds]] autorelease]; [list_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth]; [list_ setRowHeight:24.0f]; [(UITableView *) list_ setDataSource:self]; [list_ setDelegate:self]; - [[self view] addSubview:list_]; + [view addSubview:list_]; } - (void) viewDidLoad { @@ -6227,11 +6229,13 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } - (void) loadView { - [self setView:[[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]]; + UIView *view([[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]); + [view setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; + [self setView:view]; list_ = [[[UITableView alloc] initWithFrame:[[self view] bounds] style:UITableViewStylePlain] autorelease]; [list_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth]; - [[self view] addSubview:list_]; + [view addSubview:list_]; // XXX: is 20 the most optimal number here? [list_ setSectionIndexMinimumDisplayRowCount:20]; @@ -7325,14 +7329,16 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } - (void) loadView { - [self setView:[[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]]; + UIView *view([[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]); + [view setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; + [self setView:view]; list_ = [[[UITableView alloc] initWithFrame:[[self view] bounds]] autorelease]; [list_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth]; [list_ setRowHeight:45.0f]; [(UITableView *) list_ setDataSource:self]; [list_ setDelegate:self]; - [[self view] addSubview:list_]; + [view addSubview:list_]; } - (void) viewDidLoad { @@ -7507,14 +7513,16 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } - (void) loadView { - [self setView:[[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]]; + UIView *view([[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]); + [view setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; + [self setView:view]; list_ = [[[UITableView alloc] initWithFrame:[[self view] bounds] style:UITableViewStylePlain] autorelease]; [list_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth]; [list_ setRowHeight:73]; [(UITableView *) list_ setDataSource:self]; [list_ setDelegate:self]; - [[self view] addSubview:list_]; + [view addSubview:list_]; } - (void) viewDidLoad { @@ -7907,13 +7915,15 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } - (void) loadView { - [self setView:[[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]]; + UIView *view([[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]); + [view setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; + [self setView:view]; table_ = [[[UITableView alloc] initWithFrame:[[self view] bounds] style:UITableViewStyleGrouped] autorelease]; [table_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth]; [(UITableView *) table_ setDataSource:self]; [table_ setDelegate:self]; - [[self view] addSubview:table_]; + [view addSubview:table_]; subscribedSwitch_ = [[[UISwitch alloc] initWithFrame:CGRectMake(0, 0, 50, 20)] autorelease]; [subscribedSwitch_ setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin]; @@ -8503,14 +8513,16 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } - (void) loadView { - [self setView:[[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]]; + UIView *view([[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]); + [view setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; + [self setView:view]; list_ = [[[UITableView alloc] initWithFrame:[[self view] bounds] style:UITableViewStylePlain] autorelease]; [list_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth]; [list_ setRowHeight:53]; [(UITableView *) list_ setDataSource:self]; [list_ setDelegate:self]; - [[self view] addSubview:list_]; + [view addSubview:list_]; } - (void) viewDidLoad { @@ -8651,13 +8663,15 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { @implementation SettingsController - (void) loadView { - [self setView:[[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]]; + UIView *view([[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]); + [view setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; + [self setView:view]; table_ = [[[UITableView alloc] initWithFrame:[[self view] bounds] style:UITableViewStyleGrouped] autorelease]; [table_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth]; [table_ setDelegate:self]; [(UITableView *) table_ setDataSource:self]; - [[self view] addSubview:table_]; + [view addSubview:table_]; NSArray *items = [NSArray arrayWithObjects: UCLocalize("USER"), @@ -8834,8 +8848,11 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { @implementation StashController - (void) loadView { - [self setView:[[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]]; - [[self view] setBackgroundColor:[UIColor viewFlipsideBackgroundColor]]; + UIView *view([[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]); + [view setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; + [self setView:view]; + + [view setBackgroundColor:[UIColor viewFlipsideBackgroundColor]]; spinner_ = [[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge] autorelease]; CGRect spinrect = [spinner_ frame]; @@ -8843,7 +8860,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { spinrect.origin.y = [[self view] frame].size.height - 80.0f; [spinner_ setFrame:spinrect]; [spinner_ setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin]; - [[self view] addSubview:spinner_]; + [view addSubview:spinner_]; [spinner_ startAnimating]; CGRect captrect; @@ -8859,7 +8876,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { [caption_ setBackgroundColor:[UIColor clearColor]]; [caption_ setShadowColor:[UIColor blackColor]]; [caption_ setTextAlignment:UITextAlignmentCenter]; - [[self view] addSubview:caption_]; + [view addSubview:caption_]; CGRect statusrect; statusrect.size.width = [[self view] frame].size.width; @@ -8874,7 +8891,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { [status_ setBackgroundColor:[UIColor clearColor]]; [status_ setShadowColor:[UIColor blackColor]]; [status_ setTextAlignment:UITextAlignmentCenter]; - [[self view] addSubview:status_]; + [view addSubview:status_]; } - (void) releaseSubviews { |