Referencing A View In A .xib
In #ViewController.h
@interface SomeViewController : UIViewController
{
UIView *MyView;
{
@property (nonatomic, retain) IBOutlet UIView *MyView;
In #ViewController.m
@synthesize MyView; //<<<<DON'T FORGET THIS!
- (void)viewDidUnload
{
self.MyView = nil;
}
Creating Programatically
UIView *MyView = [[[UIView alloc] init] autorelease];
Moving A UIView
CGRect frame = self.MyView.frame;
frame.origin.x = 0;
self.MyView.frame = frame;
Bring A View To Front
[self.view bringSubviewToFront:MyView];
Or use this:
MyView.layer.zPosition = 1;
Hiding A View
self.MyView.hidden = YES;