SupportDeviceViewController.m 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. //
  2. // SupportDeviceViewController.m
  3. // kneet
  4. //
  5. // Created by Jason Lee on 6/22/15.
  6. // Copyright (c) 2015 ntels. All rights reserved.
  7. //
  8. #import "CommonUtil.h"
  9. #import "SupportDeviceViewController.h"
  10. #import "CustomLabel.h"
  11. #import "ImageUtil.h"
  12. @interface SupportDeviceViewController () {
  13. UIImage *_bgCellImage1, *_bgCellImage2;
  14. }
  15. @end
  16. #pragma mark - Class Definition
  17. @implementation SupportDeviceViewController
  18. - (void)viewDidLoad {
  19. [super viewDidLoad];
  20. // Do any additional setup after loading the view.
  21. [self initUI];
  22. [self prepareViewDidLoad];
  23. }
  24. - (void)initUI {
  25. self.title = NSLocalizedString(@"지원 기기 목록", @"지원 기기 목록");
  26. //set tableview option
  27. self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  28. self.tableView.backgroundColor = [UIColor clearColor];
  29. UIEdgeInsets insets = UIEdgeInsetsMake(4, 4, 4, 4);
  30. _bgCellImage1 = [ImageUtil resizableImageWithCapInsets:insets resizingMode:UIImageResizingModeStretch img:[UIImage imageNamed:@"tp_01_img_list_bg_02"]];
  31. _bgCellImage2 = [ImageUtil resizableImageWithCapInsets:insets resizingMode:UIImageResizingModeStretch img:[UIImage imageNamed:@"tp_01_img_list_bg_01"]];
  32. //Localization
  33. _lblFoscamDesc.text = NSLocalizedString(@"FOSCAM (MJPEG지원모델)", @"FOSCAM (MJPEG지원모델)");
  34. }
  35. - (void)prepareViewDidLoad {
  36. }
  37. #pragma mark - UITableView DataSource & Delegate
  38. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  39. UITableViewCell *cell = [super tableView:tableView cellForRowAtIndexPath:indexPath];
  40. //set background image
  41. if (indexPath.row % 2 == 1) {
  42. cell.backgroundView = [[UIImageView alloc] initWithImage:_bgCellImage1];
  43. } else {
  44. cell.backgroundView = [[UIImageView alloc] initWithImage:_bgCellImage2];
  45. }
  46. return cell;
  47. }
  48. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  49. [tableView deselectRowAtIndexPath:indexPath animated:YES];
  50. }
  51. - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
  52. // Remove seperator inset
  53. if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
  54. [cell setSeparatorInset:UIEdgeInsetsZero];
  55. }
  56. // Prevent the cell from inheriting the Table View's margin settings
  57. if ([cell respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]) {
  58. [cell setPreservesSuperviewLayoutMargins:NO];
  59. }
  60. // Explictly set your cell's layout margins
  61. if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
  62. [cell setLayoutMargins:UIEdgeInsetsZero];
  63. }
  64. }
  65. #pragma mark - UI Events
  66. #pragma mark - MemoryWarning
  67. - (void)didReceiveMemoryWarning
  68. {
  69. [super didReceiveMemoryWarning];
  70. // Dispose of any resources that can be recreated.
  71. }
  72. @end