// don't forget to import quartz core #import <QuartzCore/QuartzCore.h> // setting up size and position of the UIView int leftBorder = 20; int topBorder = 35; int width = 150; int height = 160; // creating new view UIView *myView = [[UIView alloc] initWithFrame:CGRectMake(leftBorder, topBorder, width, height)]; // setting up rounded corners myView.layer.cornerRadius = 10; // setting color for our view myView.backgroundColor = [UIColor redColor]; // adding our new view on the [self.view addSubview:myView];
Be aware that this functionality works with iPhone SDK 3.0 and newer, and you have to have the QuartzCore framework imported in your project :)

