#import "ViewController.h"
@interface ViewController ()
@property (strong,nonatomic) UIView *Fview;
@property (strong,nonatomic) UIView *Zview;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
_Fview = [[UIView alloc]initWithFrame:CGRectMake(120,200, 100, 100)];
_Fview.backgroundColor = [UIColor greenColor];
[self.view addSubview:_Fview];
CALayer *blayer = [[CALayer alloc]init];
blayer.frame =CGRectMake(0, 0, 100, 1);
blayer.backgroundColor = [UIColor blackColor].CGColor;
[_Fview.layer addSublayer:blayer];
_Zview = [[UIView alloc]initWithFrame:CGRectMake(20,-10, 100, 120)];
_Zview.backgroundColor = [UIColor redColor];
[_Fview addSubview:_Zview];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end