Skip to content

Instantly share code, notes, and snippets.

@shayne
Created December 13, 2009 07:50
Show Gist options
  • Save shayne/255335 to your computer and use it in GitHub Desktop.
Save shayne/255335 to your computer and use it in GitHub Desktop.
#import <UIKit/UIKit.h>
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, @"RoundedCornerTestAppDelegate");
[pool release];
return retVal;
}
#import <UIKit/UIKit.h>
@interface RoundedCornerTestAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window_;
}
@end
#import "RoundedCornerTestAppDelegate.h"
#import <QuartzCore/QuartzCore.h>
@implementation RoundedCornerTestAppDelegate
- (void)applicationDidFinishLaunching:(UIApplication *)application {
window_ = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UINavigationBar *navBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 20, 320, 42)];
[window_ addSubview:navBar];
UIView *tab = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 75, 40)] autorelease];
tab.backgroundColor = [UIColor colorWithRed:228.0/255.0
green:230.0/255.0
blue:235.0/255.0
alpha:1];
tab.layer.cornerRadius = 5;
UIView *tabContainer = [[[UIView alloc] initWithFrame:CGRectMake(0, 5, 75, 35)] autorelease];
tabContainer.clipsToBounds = YES;
[tabContainer addSubview:tab];
[navBar addSubview:tabContainer];
[window_ makeKeyAndVisible];
}
- (void)dealloc {
[window_ release];
[super dealloc];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment