day1
1/UIWindow
iphone4s和iphone5的尺寸
2/UIView
bounds与frame的区别.
状态栏的尺寸。
设置了一个小动画:view的通明度和位置发生变化。
3/UILabel
用于显示文字,但是不能编辑文字。
定义,显示文字,设置背景颜色,设置文字的对齐方式,设置字体大小和是否加粗。
拿到各种字体名称。
设置阴影文字的偏移量和颜色。
设置文字显示的行数跟换行方式。
4/UIButton
定义btn并设置显示效果,设置btn的title和显示状态(常态,点击状态),设置标题颜色,设置标题字体,
给按钮设置背景图片,
5/ButtonChess
制作黑白view棋盘,制作btn棋子,棋子的点击事件,
bringSubviewToFront 将wingdow的某个子视图放在最上层。[self.window bringSubviewToFront:btn] .(window为btn和view的父视图)。
day2 code
1/UITextField
用于注册,登录,能够展示文本数据,并且能够与用户进行交互。
设置尺寸,显示样式,设置默认提示文字(placeholder),设置出现清楚按钮,设置密码样式,设置弹出键盘样式,更改右下角按键样式。
设置代理触发开始编辑,编辑结束,按下右下角,触发方法。
2/UIViewController详解
视图控制器的生命周期。(viewWillAppear,didappera,willdisapperar,diddisappear),
获取UIApplication对象。UIApplication *app = [UIApplication sharedApplication];
AppDelegate *delegate = (AppDelegate *)app.delegate;
[delegate.array addObject:@“一步之遥”];
切换视图:root->sub :[self presentViewController:sub animated:YES completion:^{}]]
sub->root :[self dismissive…….];
3/UIViewController1
用childViewControllers管理视图切换。存:[self addChildViewController:third]; 用:ThirdViewController *third = (ThirdViewController*)self.childViewControllers[0];
4/UIViewController&&UIView
设置视图的层次结构://将某个子视图放在最上层
[self.viewbringSubviewToFront:redView];
//将某个子视图放在最底层
[self.viewsendSubviewToBack:redView];
//[self.view insertSubview:<#(UIView *)#> aboveSubview:<#(UIView *)#>]
//[self.view insertSubview:<#(UIView *)#> belowSubview:<#(UIView *)#>];
//[self.view insertSubview:<#(UIView *)#> atIndex:(NSInteger)]
设置子视图的自适应模式 (设置子视图的宽、高随着父视图变化):orangeView.autoresizingMask =UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
通过父视图和子视图的tag值,拿到子视图:UIView *blackView = (UIView *)[self.viewviewWithTag:200];
5/Day2Project
封装了一个MyControl,自定义生成按钮,标签,输入框。
day2 homework
1/计算
2/九九乘法表
day3 code
1/UIImageView 用于加载和展示图片
两种加载图片的方式 :NSString *path = [[NSBundlemainBundle] pathForResource:@"map"ofType:@"png"];
//根据路径得到UIImage对象,不会一直占用程序的活跃内存(非常重要)
UIImage *image = [UIImageimageWithContentsOfFile:path];
NSString *imageName = [NSStringstringWithFormat:@"player%d.png",i];
UIImage *image = [UIImageimageNamed:imageName];
设置图片轮播:imageView.animationImages = imageArray;
2/UINavigationController1 导航控制器,通过栈的方式管理多个视图控制器
day3 homework
1/蓝色线条随机变化
2/ 注册公司,并保留结果。 用单例方法实现两个界面的传值
day4 code
1/UINavigationBar导航条
设置透明度 : self.navigationController.navigationBar.translucent =YES;
是否隐藏: //通过导航控制器,隐藏导航条 [self.navigationControllersetNavigationBarHidden:YESanimated:YES];
贴图:[self.navigationController.navigationBarsetBackgroundImage:[UIImageimageNamed:@"navBg.png"]forBarMetrics:UIBarMetricsDefault];
2/UINavigationItem 决定导航条的显示
设置标题
设置标题视图
设置导航条上面的按钮
自定义导航栏上面的按钮
3/CommonControls
UISwitch 开关
UIActivityIndicatorView 等待提示控件
4/RenRenProject 人人登陆界面
5/Xib 用视图View讲解各类控件
day5 code
1/UITabBarController
2/ConmonControls 用代码实现UISwitch, UIActivityIndicatorView, UISlider(滑动条), UISegmentedControl(分段选取器)
3/customTabBarController里面没有东西
4/NSUserDefaults 用于存储数据,实际上十个plist文件,类似于字典。
day6 code
1/Custom TabBar :完全自定义用标签栏实现界面的切换。
self.viewControllers = [NSArray arraywithObjects:vc1, vc2, vc3, vc4, nil];
self.selectedIndex = index. (index可以是0,1,2,3),这样实现不同视图控制器切换。
2/ScrollView&&PageControl : 图片切换和显示
3/UIScrollView : 用UIScrollView来完整显示一张图片。
contensize
bounces
contenOffset
maximumZoomScale
minimumZoomScale
//设置内容视图的缩放- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
//scrollView滚动时,会时时调用此方法- (void)scrollViewDidScroll:(UIScrollView *)scrollView
//开始拖拽scrollView时,调用此方法- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
//减速到停止时,触发此方法,(必须有减速的过程)- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
4/UIGesture : 通过添加手势实现可以随意移动imageView
UITapGestureRecognizer
UIPanGestureRecognizer