Guest User

Untitled

a guest
Feb 21st, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (void)viewDidLoad
  2. {
  3.     [super viewDidLoad];
  4.    
  5.     self.view.backgroundColor = kColorDarkRed;
  6.    
  7.     UIImage *image = [UIImage imageNamed:@"main_screen_image_background.png"];
  8.     UIImageView *background = [[UIImageView alloc] initWithImage:image];
  9.     background.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
  10.     background.userInteractionEnabled = NO;
  11.  
  12.     UIButton *startButton = [UIButton buttonWithType:UIButtonTypeCustom];
  13.     startButton.frame = CGRectMake(75.0, 380.0, 170.0, 70.0);
  14.     [startButton setImage:[UIImage imageNamed:@"main_screen_image_start_button_normal.png"] forState:UIControlStateNormal];
  15.     [startButton setImage:[UIImage imageNamed:@"main_screen_image_start_button_highlighted.png"] forState:UIControlStateHighlighted];
  16.    
  17.     [startButton addTarget:self action:@selector(startButtonTouched) forControlEvents:UIControlEventTouchUpInside];
  18.     [startButton setUserInteractionEnabled:YES];
  19.    
  20.     UIButton *infoButton = [UIButton buttonWithType:UIButtonTypeCustom];
  21.     infoButton.frame = CGRectMake(290, 10, 20, 24);
  22.     [infoButton setImage:[UIImage imageNamed:@"main_screen_image_info_button_normal.png"] forState:UIControlStateNormal];
  23.     [infoButton setImage:[UIImage imageNamed:@"main_screen_image_info_button_highlighted.png"] forState:UIControlStateHighlighted];
  24.    
  25.     UIButton *mentionMobileButton = [UIButton buttonWithType:UIButtonTypeCustom];
  26.     mentionMobileButton.frame = CGRectMake(10, 10, 108, 22);
  27.     [mentionMobileButton setImage:[UIImage imageNamed:@"main_screen_image_mention_mobile_button.png"] forState:UIControlStateNormal];
  28.    
  29.     scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(26.0, 120.0, 270.0, 250.0)];
  30.     [scrollView setBackgroundColor:[UIColor whiteColor]];
  31.     [scrollView setShowsHorizontalScrollIndicator:NO];
  32.     [scrollView setShowsVerticalScrollIndicator:NO];
  33.    
  34.     UIImage *im0 = [UIImage imageNamed:@"placeholder.png"];
  35.  
  36.     UIImageView *imv0 = [[UIImageView alloc] initWithImage:im0];
  37.     UIImageView *imv1 = [[UIImageView alloc] initWithImage:im0];
  38.     UIImageView *imv2 = [[UIImageView alloc] initWithImage:im0];
  39.     UIImageView *imv3 = [[UIImageView alloc] initWithImage:im0];
  40.     UIImageView *imv4 = [[UIImageView alloc] initWithImage:im0];
  41.     UIImageView *imv5 = [[UIImageView alloc] initWithImage:im0];
  42.    
  43.     [scrollView addSubview:imv0];
  44.     [scrollView addSubview:imv1];
  45.     [scrollView addSubview:imv2];
  46.     [scrollView addSubview:imv3];
  47.    
  48.     imv0.frame = CGRectMake(scrollView.bounds.origin.x + PICTURES_LATERAL_MARGIN, scrollView.bounds.origin.y + PICTURES_TOP_MARGIN, MAIN_SCREEN_PICTURE_WIDTH, MAIN_SCREEN_PICTURE_HEIGHT);
  49.     imv1.frame = CGRectMake(scrollView.bounds.origin.x + PICTURES_LATERAL_MARGIN + MAIN_SCREEN_PICTURE_WIDTH + PICTURES_INNER_SPACING, scrollView.bounds.origin.y + PICTURES_TOP_MARGIN, MAIN_SCREEN_PICTURE_WIDTH, MAIN_SCREEN_PICTURE_HEIGHT);
  50.    
  51.     imv2.frame = CGRectMake(scrollView.bounds.origin.x + PICTURES_LATERAL_MARGIN, scrollView.bounds.origin.y + PICTURES_TOP_MARGIN + MAIN_SCREEN_PICTURE_HEIGHT + PICTURES_INNER_SPACING, MAIN_SCREEN_PICTURE_WIDTH, MAIN_SCREEN_PICTURE_HEIGHT);
  52.     imv3.frame = CGRectMake(scrollView.bounds.origin.x + PICTURES_LATERAL_MARGIN + MAIN_SCREEN_PICTURE_WIDTH + PICTURES_INNER_SPACING, scrollView.bounds.origin.y + PICTURES_TOP_MARGIN + MAIN_SCREEN_PICTURE_HEIGHT + PICTURES_INNER_SPACING, MAIN_SCREEN_PICTURE_WIDTH, MAIN_SCREEN_PICTURE_HEIGHT);
  53.    
  54.    
  55.     [scrollView setContentSize:(CGSizeMake(scrollView.frame.size.width, PICTURES_BOTTOM_MARGIN + PICTURES_TOP_MARGIN + 2.0*(MAIN_SCREEN_PICTURE_HEIGHT) + 1.0*10.0))];
  56.  
  57.     [self.view addSubview:scrollView];
  58.     [self.view addSubview:background];
  59.     [self.view addSubview:mentionMobileButton];
  60.     [self.view addSubview:startButton];
  61.     [self.view addSubview:infoButton];
  62.    
  63.    
  64. }
Add Comment
Please, Sign In to add comment