#import "AppDelegate.h"app
@interface AppDelegate ()ide
@end spa
@implementation AppDelegate.net
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {3d
// Override point for customization after application launch.orm
_window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];繼承
[_window setBackgroundColor:[UIColor whiteColor]];圖片
//======================================get
UIView *view = [[UIView alloc]initWithFrame:animation
CGRectMake(100, 100, 100, 100)];
//系統提供的全部的視圖類都是直接或者間接繼承自UIView
//能夠顯示內容
//顯示內容的實質是由於UIView類中提供了不一樣的draw方法;
//全部的視圖都有形狀,形狀是由layer決定的;每一個視圖都有layer;
//若是想要改變視圖的形狀,必須經過layer去改變;
view.backgroundColor = [UIColor orangeColor];
//2.切圓角
//參數就是圓角半徑
[view.layer setCornerRadius:50];
//切圓角若是是帶切圖片的控件,必須帶上如下代碼有效
view.layer.masksToBounds = YES;
//3.畫邊框
//設置邊框寬度
view.layer.borderWidth = 2;
//設置邊框顏色
[view.layer setBorderColor:[UIColor greenColor].CGColor];
[UIView animateWithDuration:2 animations:^{
//view.frame = CGRectMake(100, 100, 50, 50);
//若是設置了layer就不能經過frame改變視圖的大小,
//只能經過形變去改變大小
view.transform = CGAffineTransformMakeScale(0.5, 0.5);
}];
[_window addSubview:view];
[_window makeKeyAndVisible];
return YES;
}