OrderDetailHtmlCell.m 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //
  2. // OrderDetailHtmlCell.m
  3. // RedAnt ERP Mobile
  4. //
  5. // Created by Ray on 12/3/15.
  6. // Copyright © 2015 United Software Applications, Inc. All rights reserved.
  7. //
  8. #import "OrderDetailHtmlCell.h"
  9. @implementation OrderDetailHtmlCell
  10. - (void)awakeFromNib {
  11. // Initialization code
  12. [super awakeFromNib];
  13. [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
  14. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deviceOrientationDidChange:) name:UIDeviceOrientationDidChangeNotification object:nil];
  15. self.wkwebview.scrollView.scrollEnabled = NO;
  16. // self.wkwebview.scrollView.alwaysBounceVertical = NO;
  17. // self.wkwebview.scrollView.showsHorizontalScrollIndicator = NO;
  18. // self.wkwebview.scrollView.showsVerticalScrollIndicator=NO;
  19. // self.wkwebview.scrollView.bouncesZoom = NO;
  20. }
  21. - (void)dealloc
  22. {
  23. [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
  24. [[NSNotificationCenter defaultCenter] removeObserver:self name:UIDeviceOrientationDidChangeNotification object:nil];
  25. }
  26. // Handle device orientation changes
  27. - (void)deviceOrientationDidChange: (NSNotification *)notification
  28. {
  29. // 如果显示不正常,可以尝试开放以下代码;
  30. // if(self.html==nil)
  31. // {
  32. // [self.wkwebview reload];
  33. // }
  34. // else
  35. // {
  36. // [self.wkwebview loadHTMLString:self.html baseURL:nil];
  37. // }
  38. }
  39. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  40. [super setSelected:selected animated:animated];
  41. // Configure the view for the selected state
  42. }
  43. @end