//
// ViewController.m
// 0722
//
// Created by 范小丽 on 2020/6/10.
// Copyright © 2020 范小丽. All rights reserved.
//
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
//添加yellowView到控制视图self.view
UIView *yellowView = [[UIView alloc]init];
yellowView.frame = CGRectMake(100,100, 200, 200);
yellowView.backgroundColor = [UIColor yellowColor];
[self.view addSubview:yellowView];
NSLog(@"yellowView.frame:%@",NSStringFromCGRect(yellowView.frame));
NSLog(@"yellowView.bounds:%@",NSStringFromCGRect(yellowView.bounds));
NSLog(@"yellowView.center:%@",NSStringFromCGPoint(yellowView.center));
//添加redView到控制器视图self.view
UIView *redView = [[UIView alloc]init];
redView.frame = CGRectMake(300, 300,100, 100);
redView.backgroundColor = [UIColor redColor];
[self.view addSubview:redView];
NSLog(@"redView.frame:%@",NSStringFromCGRect(redView.frame));
NSLog(@"redView.bounds:%@",NSStringFromCGRect(redView.bounds));
NSLog(@"redView.center:%@",NSStringFromCGPoint(redView.center));
//添加blueView到视图控制器
UIView *blueView = [[UIView alloc]init];
blueView.frame = CGRectMake(0, 0,100, 100);
blueView.backgroundColor = [UIColor blueColor];
[self.view addSubview:blueView];
NSLog(@"redView.frame:%@",NSStringFromCGRect(blueView.frame));
NSLog(@"redView.bounds:%@",NSStringFromCGRect(blueView.bounds));
NSLog(@"redView.center:%@",NSStringFromCGPoint(blueView.center));
}
-(BOOL)prefersStatusBarHidden{
return YES;
}
-(void)didReceiveMemoryWarning{
[super didReceiveMemoryWarning];
}
@end

1万+

被折叠的 条评论
为什么被折叠?



