Advertisement
Guest User

Untitled

a guest
Jun 30th, 2012
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. UIScrollView and UIPageControl within UITableView
  2. UITableViewCell *cell = [self.challengeListView dequeueReusableCellWithIdentifier:SubmitChallengeCellIdentifier];
  3. if(cell == nil){
  4. cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:SubmitChallengeCellIdentifier] autorelease];
  5. cell.frame = CGRectMake(0, 0, 1000, 50);
  6. }
  7.  
  8. scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, tv.frame.size.width, 50)];
  9. [scrollView setContentSize:CGSizeMake(1000, 50)];
  10. [[cell contentView] addSubview:scrollView];
  11.  
  12. pageControl = [[UIPageControl alloc] initWithFrame:CGRectMake(0, 50, tv.frame.size.width, 50)];
  13. [pageControl setNumberOfPages:4];
  14. [[cell contentView] addSubview:pageControl];
  15.  
  16. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  17. {
  18. return 1;
  19. }
  20.  
  21. -(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  22. {
  23. return 1;
  24. }
  25.  
  26. scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, tv.frame.size.width, 78)];
  27.  
  28. UIImage *image = [UIImage imageNamed:@"dummy.png"];
  29. UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
  30. imageView.frame = CGRectMake(0, 0, 80, 78);
  31. [scrollView addSubview: imageView];
  32.  
  33. [[cell contentView] addSubview:scrollView];
  34.  
  35. pageControl = [[UIPageControl alloc] initWithFrame:CGRectMake(0, 50, tv.frame.size.width, 50)];
  36. [pageControl setNumberOfPages:4];
  37. [[cell contentView] addSubview:pageControl];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement