UI 创建见View视图
来源:互联网 发布:51单片机蜂鸣器电路图 编辑:程序博客网 时间:2024/05/14 08:00
#import "TestDicAppDelegate.h"
@implementation TestDicAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//产生一个window对象,使它和屏幕的大小一样。
self.window = [[UIWindowalloc] initWithFrame:[[UIScreenmainScreen] bounds]];
// Override point for customization after application launch.
self.window.backgroundColor = [UIColorblackColor];
// 把window对象 设置为主window,并且可见。
[self.windowmakeKeyAndVisible];
// 1.建立一个UIView对象:
// 2.UIView通过CGRect结构体确定位置大小。
UIView *view9 = [[UIViewalloc] initWithFrame:(CGRectMake(150,10, 200, 440))];
[view9 setBackgroundColor:[UIColordarkGrayColor]];
[self.windowaddSubview:view9];
UIView *view8 = [[UIViewalloc] initWithFrame:(CGRectMake(130,20, 190, 405))];
[view8 setBackgroundColor:[UIColororangeColor]];
view8.alpha = 0.9; //透明度
view8.hidden = NO; //隐藏
view8.tag =10000; //设置view的tag值(作用:方便父视图快速定位子视图)
[self.windowaddSubview:view8];
NSLog(@"%@", view8.superview);
// 通过tag寻找子视图
// UIView *viewTemp = [self.window viewWithTag:10000];
UIView *view7 = [[UIViewalloc] initWithFrame:(CGRectMake(110,40, 180, 355))];
[view7 setBackgroundColor:[UIColorpurpleColor]];
[self.windowaddSubview:view7];
UIView *view6 = [[UIViewalloc] initWithFrame:(CGRectMake(90,60, 170, 305))];
[view6 setBackgroundColor:[UIColorbrownColor]];
[self.windowaddSubview:view6];
UIView *view3 = [[UIViewalloc] initWithFrame:(CGRectMake(70,80, 160, 255))];
[view3 setBackgroundColor:[UIColorblueColor]];
[self.windowaddSubview:view3];
UIView *view = [[UIViewalloc] initWithFrame:CGRectMake(50,100, 150, 205)];
[view setBackgroundColor:[UIColoryellowColor]];
// 3.将view对象添加到 window 上
[self.windowaddSubview:view];
UIView *view1 = [[UIViewalloc] initWithFrame:(CGRectMake(30,120, 140, 155))];
[view1 setBackgroundColor:[UIColorgreenColor]];
[self.windowaddSubview:view1];
UIView *view2 = [[UIViewalloc] initWithFrame:(CGRectMake(10,140, 130, 105))];
[view2 setBackgroundColor:[UIColorredColor]];
[self.windowaddSubview:view2];
UIView *view4 = [[UIViewalloc] initWithFrame:(CGRectMake(-10,160, 120, 55))];
[view4 setBackgroundColor:[UIColorcyanColor]];
[self.windowaddSubview:view4];
UIView *view5 = [[UIViewalloc] initWithFrame:(CGRectMake(20,180, 70, 15))];
[view5 setBackgroundColor:[UIColormagentaColor]];
view5.alpha = 0.5;
[self.windowaddSubview:view5];
// 改变中心点
// view3.center = CGPointMake(0, 0);
// 4.内存管理(释放)
[view release];
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application
{
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
- (void)applicationWillTerminate:(UIApplication *)application
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
@end
- UI 创建见View视图
- UI创建霓虹灯视图
- UI设计 创建视图
- oracle 创建视图view
- MySQL创建View视图
- IOS界面UI设计7之UIWindown、多种方式创建视图控制器、View
- 创建视图CREATE VIEW 删除视图DROP VIEW 使用视图
- 使用CREATE VIEW创建视图
- SQL创建视图(CREATE VIEW)
- View视图的创建过程
- oracle 视图view的创建
- Oracle视图(View)创建使用
- UI 创建一个view对象
- angularjs ui-view 子页视图切换
- 多文档下创建自定义视图(view)
- Oracle MATERIALIZED VIEW -- 创建物化视图
- Oracle MATERIALIZED VIEW -- 创建物化视图
- 视图控制器的view创建方式
- android中Button控件
- 在你的 iOS App中 使用 OpenSSL 库
- [收藏]c#与word
- Python 3 函数式编程之列表解析的坑
- 每天学习一点编程(14)(数组/字符串循环移位)
- UI 创建见View视图
- 谷歌最大的难题:移动搜索营收不断下降
- dedecms标签:channelartlist当前频道的下级栏目的内容列表
- ZOJ-1884
- block使用小结、在arc中使用block、如何防止循环引用
- sdfgh
- 迭代器和下标之间转换
- jdbc连接sqlserver2008过程注意几点(非web项目)
- 修改smali文件重新编译后出现 java.lang.VerifyError: