Successfully reported this slideshow.
Your SlideShare is downloading. ×

Squeek School #3

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad

Check these out next

1 of 23 Ad

More Related Content

Similar to Squeek School #3 (20)

Advertisement

Recently uploaded (20)

Squeek School #3

  1. 1. squeek school Разработка приложений для iOS
  2. 2. team@squeek.ru
  3. 3. MVC?
  4. 4. MVC Parts of a Screenful Model View Controller Friday, January 22, 2010 12
  5. 5. MVCParts adress book в of a Screenful Model View Controller Friday, January 22, 2010 11
  6. 6. view • прямоугольная часть экрана • показывает и принимает события • view существуют в иерархии: один superview, много subview • все view показаны в window • UIWindow - одно на всё приложение
  7. 7. иерархия view Либо в IB, либо программно: • [superView addSubview:view]; • [subView removeFromSuperview]; Управление иерархией: - (void)insertSubview:(UIView *)view atIndex:(int)index; - (void)insertSubview:(UIView *)view belowSubview:(UIView *)view; - (void)insertSubview:(UIView *)view aboveSubview:(UIView *)view; - (void)exchangeSubviewAtIndex:(int)index withSubviewAtIndex:(int)otherIndex;
  8. 8. view SuperView производит retain Контроль показа view theView.hidden = YES;
  9. 9. структуры для view • CGPoint точка в пространстве { x , y } • CGSize размеры { width , height } • CGRect точка и размеры { origin , size }
  10. 10. Rects, Points and Sizes CGRect (0, 0) x 54 origin CGPoint x 80 80 size y 54 y 144 CGSize width 144 72 height 72 Tuesday, January 19, 2010 11
  11. 11. View-related Structure работа со структурами Creation Function Example CGPoint point = CGPointMake (100.0, 200.0); CGPointMake (x, y) point.x = 300.0; point.y = 30.0; CGSize size = CGSizeMake (42.0, 11.0); CGSizeMake (width, height) size.width = 100.0; size.height = 72.0; CGRect rect = CGRectMake (100.0, 200.0, CGRectMake (x, y, 42.0, 11.0); width, height) rect.origin.x = 0.0; rect.size.width = 50.0; синтаксис! Tuesday, January 19, 2010 (), нет * 12 наследство от С
  12. 12. ordinate System left corner wnwards система координат 0,!0 +x +y
  13. 13. view frame bounds координатная система локальная superview координатная система используется при используется при использовании view реализации view
  14. 14. создаём view CGRect frame = CGRectMake(20, 45, 140, 21); UILabel *label = [[UILabel alloc] initWithFrame:frame]; [window addSubview:label]; [label setText:@”Привет всем!”]; [label release];
  15. 15. дополнительные бонусы UIColor UIColor *redColor = [UIColor redColor]; [myLabel setTextColor:redColor]; UIFont UIFont *font = [UIFont systemFontOfSize:14.0]; [myLabel setFont:font];
  16. 16. UIImage и UIImageView Создание UIImage: из ресурсов: +[UIImage imageNamed:(NSString *)name] с диска -[UIImage initWithContentsOfFile:(NSString *)path] из памяти в виде данных -[UIImage initWithData:(NSData *)data] UIImage *myImage = [UIImage imageNamed:@’‘oleg.jpg’’]; CGRect frame = CGRectMake(20, 45, 140, 21); UIImageView *myImageView = [[UIImageView alloc] initWithFrame:frame]; myImageView.image = myImage; [self.view addSubview:myImageView]; [myImageView release];
  17. 17. пример UIImage
  18. 18. простая анимация -(IBAction)changeValue { [UIView beginAnimations:@"advancedAnimations" context:nil]; [UIView setAnimationDuration:0.5]; int value = slider.value; [label setText:[NSString stringWithFormat:@"%d",value]]; CGRect fr = label.frame; fr.origin.y += 40; label.frame = fr; [UIView commitAnimations]; }
  19. 19. пример анимации
  20. 20. дизайн приложений в Two Flavors of Mail iPhone
  21. 21. сравни Organizing Content Organizing Content Friday, January 22, 2010 Friday, January 22, 2010 6
  22. 22. дизайн Organizing Content • фокус на • Focus on yo информацию • One thing a • Screenfuls o пользователя • один функционал единовременно • правило большого пальца Friday, January 22, 2010

Editor's Notes

  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

×