Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Commit

Permalink
[TTCatlog] remove fixed widths to make it universal
Browse files Browse the repository at this point in the history
  • Loading branch information
dlackty authored and jverkoey committed Jul 22, 2010
1 parent 8590b6f commit a688b46
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions samples/TTCatalog/Classes/MessageTestController.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ - (void)loadView {
[button setTitle:@"Show TTMessageController" forState:UIControlStateNormal];
[button addTarget:@"tt://compose?to=Alan%20Jones" action:@selector(openURL)
forControlEvents:UIControlEventTouchUpInside];
button.frame = CGRectMake(20, 20, 280, 50);
button.frame = CGRectMake(20, 20, appFrame.size.width - 40, 50);
[self.view addSubview:button];

UIButton* button2 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button2 setTitle:@"Show TTPostController" forState:UIControlStateNormal];
[button2 addTarget:@"tt://post" action:@selector(openURLFromButton:)
forControlEvents:UIControlEventTouchUpInside];
button2.frame = CGRectMake(20, button.bottom + 20, 280, 50);
button2.frame = CGRectMake(20, button.bottom + 20, appFrame.size.width - 40, 50);
[self.view addSubview:button2];
}

Expand Down
10 changes: 6 additions & 4 deletions samples/TTCatalog/Classes/TabBarTestController.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ - (void)dealloc {
}

- (void)loadView {
self.view = [[[UIView alloc] initWithFrame:[UIScreen mainScreen].applicationFrame] autorelease];
CGRect applicationFrame = [UIScreen mainScreen].applicationFrame;

self.view = [[[UIView alloc] initWithFrame:applicationFrame] autorelease];
self.view.backgroundColor = TTSTYLEVAR(tabTintColor);

_tabBar1 = [[TTTabStrip alloc] initWithFrame:CGRectMake(0, 0, 320, 41)];
_tabBar1 = [[TTTabStrip alloc] initWithFrame:CGRectMake(0, 0, applicationFrame.size.width, 41)];
_tabBar1.tabItems = [NSArray arrayWithObjects:
[[[TTTabItem alloc] initWithTitle:@"Item 1"] autorelease],
[[[TTTabItem alloc] initWithTitle:@"Item 2"] autorelease],
Expand All @@ -29,7 +31,7 @@ - (void)loadView {
nil];
[self.view addSubview:_tabBar1];

_tabBar2 = [[TTTabBar alloc] initWithFrame:CGRectMake(0, _tabBar1.bottom, 320, 40)];
_tabBar2 = [[TTTabBar alloc] initWithFrame:CGRectMake(0, _tabBar1.bottom, applicationFrame.size.width, 40)];
_tabBar2.tabItems = [NSArray arrayWithObjects:
[[[TTTabItem alloc] initWithTitle:@"Banana"] autorelease],
[[[TTTabItem alloc] initWithTitle:@"Cherry"] autorelease],
Expand All @@ -42,7 +44,7 @@ - (void)loadView {
TTTabItem* item = [_tabBar2.tabItems objectAtIndex:1];
item.badgeNumber = 2;

_tabBar3 = [[TTTabGrid alloc] initWithFrame:CGRectMake(10, _tabBar2.bottom+10, 300, 0)];
_tabBar3 = [[TTTabGrid alloc] initWithFrame:CGRectMake(10, _tabBar2.bottom+10, applicationFrame.size.width - 20, 0)];
_tabBar3.backgroundColor = [UIColor clearColor];
_tabBar3.tabItems = [NSArray arrayWithObjects:
[[[TTTabItem alloc] initWithTitle:@"Banana"] autorelease],
Expand Down

0 comments on commit a688b46

Please sign in to comment.