1
我描述了[self.view addSubView:myView];
,
但是,myView沒有顯示self.view
。addSubview is not displayed UIView
ViewController.h
@interface ViewController : UIViewController{
UIView *myView;
}
@property (nonatomic, strong) UIView *myView;
ViewController.m
@synthesize myView;
- (void)viewDidLoad
{
[super viewDidLoad];
myView.frame = CGRectMake(-10, 70, 320, 480);
[self.view addSubview:myView];
myView.backgroundColor = [UIColor redColor];
[self.view bringSubviewToFront:myView];
}
你有什麼辦法呢?
我解決了problem.Thank你。 –