Skip to content

Instantly share code, notes, and snippets.

@vojto
Created February 10, 2010 13:49
Show Gist options
  • Save vojto/300319 to your computer and use it in GitHub Desktop.
Save vojto/300319 to your computer and use it in GitHub Desktop.
// *** Navigation View
var navigationView = [[CPView alloc] initWithFrame:CGRectMake(0, 0, 230, CGRectGetHeight([contentView bounds]))];
var sidebarPatternImage = [[CPImage alloc] initWithContentsOfFile:@"Resources/sidebar.png"];
var sidebarBackground = [CPColor colorWithPatternImage:sidebarPatternImage];
[navigationView setBackgroundColor:sidebarBackground];
// *** Main View
var mainView = [[CPView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth([contentView bounds])-230, CGRectGetHeight([contentView bounds]))];
[mainView setAutoresizingMask: CPViewHeightSizable | CPViewWidthSizable]
// [mainView setAutoresizingMask:CPViewWidthSizable];
[mainView setBackgroundColor:[CPColor colorWithHexString:@"f0f0f0"]];
// *** Split View
var splitView = [[CPSplitView alloc] initWithFrame:[containerView bounds]];
[splitView setAutoresizingMask:CPViewHeightSizable | CPViewWidthSizable ];
[splitView setVertical:YES];
[splitView setIsPaneSplitter:YES];
[splitView addSubview:navigationView];
[splitView addSubview:mainView];
[containerView addSubview:splitView];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment