view.backgroundColor = [UIColor colorWithPatternImage:image];
#import <QuartzCore/QuartzCore.h> imageView.layer.cornerRadius = 1; imageView.clipsToBounds = true;
sendSubviewToBack
bringSubviewToFront
CustomViewと名付ける。
UIViewを継承する。 initを次の様に書く
self = [super initWithFrame:frame];
if (self) {
// Initialization code
NSArray *arr = [[NSBundle mainBundle] loadNibNamed:@"CustomView" owner:self options:nil];
[self addSubview:[arr objectAtIndex:0]];
}
return self;
もしくは
UINib *nib = [UINib nibWithNibName:name bundle:[NSBundle mainBundle]]; NSArray *objects = [nib instantiateWithOwner:self options:nil]; [self.view addSubview:self.hogeView];
普通にCustomViewをallocしてやればOK。