口袋版本的一折买

SDCollectionViewCell.m 7.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. //
  2. // SDCollectionViewCell.m
  3. // SDCycleScrollView
  4. //
  5. // Created by aier on 15-3-22.
  6. // Copyright (c) 2015年 GSD. All rights reserved.
  7. //
  8. /*
  9. *********************************************************************************
  10. *
  11. * 🌟🌟🌟 新建SDCycleScrollView交流QQ群:185534916 🌟🌟🌟
  12. *
  13. * 在您使用此自动轮播库的过程中如果出现bug请及时以以下任意一种方式联系我们,我们会及时修复bug并
  14. * 帮您解决问题。
  15. * 新浪微博:GSD_iOS
  16. * Email : gsdios@126.com
  17. * GitHub: https://github.com/gsdios
  18. *
  19. * 另(我的自动布局库SDAutoLayout):
  20. * 一行代码搞定自动布局!支持Cell和Tableview高度自适应,Label和ScrollView内容自适应,致力于
  21. * 做最简单易用的AutoLayout库。
  22. * 视频教程:http://www.letv.com/ptv/vplay/24038772.html
  23. * 用法示例:https://github.com/gsdios/SDAutoLayout/blob/master/README.md
  24. * GitHub:https://github.com/gsdios/SDAutoLayout
  25. *********************************************************************************
  26. */
  27. #import "SDCollectionViewCell.h"
  28. #import "UIView+SDExtension.h"
  29. @implementation SDCollectionViewCell
  30. {
  31. __weak UILabel *_titleLabel;
  32. }
  33. - (instancetype)initWithFrame:(CGRect)frame
  34. {
  35. if (self = [super initWithFrame:frame]) {
  36. self.layer.cornerRadius = 5;
  37. self.layer.masksToBounds = YES;
  38. self.clipsToBounds = YES;
  39. [self setupImageView];
  40. [self setupTitleLabel];
  41. [self setUpSubjectLabel];
  42. }
  43. return self;
  44. }
  45. - (void)setTitleLabelBackgroundColor:(UIColor *)titleLabelBackgroundColor
  46. {
  47. _titleLabelBackgroundColor = titleLabelBackgroundColor;
  48. _titleLabel.backgroundColor = titleLabelBackgroundColor;
  49. }
  50. - (void)setTitleLabelTextColor:(UIColor *)titleLabelTextColor
  51. {
  52. _titleLabelTextColor = titleLabelTextColor;
  53. _titleLabel.textColor = titleLabelTextColor;
  54. }
  55. - (void)setTitleLabelTextFont:(UIFont *)titleLabelTextFont
  56. {
  57. _titleLabelTextFont = titleLabelTextFont;
  58. _titleLabel.font = titleLabelTextFont;
  59. }
  60. - (void)setupImageView
  61. {
  62. UIImageView *imageView = [[UIImageView alloc] init];
  63. imageView.backgroundColor = [UIColor yhGrayColor];
  64. _imageView = imageView;
  65. _imageView.layer.cornerRadius = 5;
  66. _imageView.layer.masksToBounds = YES;
  67. _imageView.clipsToBounds = YES;
  68. [self.contentView addSubview:imageView];
  69. }
  70. - (void)setupTitleLabel
  71. {
  72. UILabel *titleLabel = [[UILabel alloc] init];
  73. _titleLabel = titleLabel;
  74. _titleLabel.hidden = YES;
  75. [self.contentView addSubview:titleLabel];
  76. }
  77. - (void)setUpSubjectLabel {
  78. _subjectLb = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 20)];
  79. _subjectLb.backgroundColor = [UIColor redColor];
  80. _subjectLb.text = @"专题";
  81. _subjectLb.font = [UIFont systemFontOfSize:14];
  82. _subjectLb.textAlignment = NSTextAlignmentCenter;
  83. _subjectLb.textColor = [UIColor whiteColor];
  84. [self.imageView addSubview:_subjectLb];
  85. _subjectLb.hidden = YES;
  86. }
  87. - (void)setTitle:(NSString *)title
  88. {
  89. _title = [title copy];
  90. _titleLabel.text = [NSString stringWithFormat:@" %@", title];
  91. if (_titleLabel.hidden) {
  92. _titleLabel.hidden = NO;
  93. }
  94. }
  95. - (void)layoutSubviews
  96. {
  97. [super layoutSubviews];
  98. if (self.onlyDisplayText) {
  99. _titleLabel.frame = self.bounds;
  100. } else {
  101. _imageView.frame = self.bounds;
  102. CGFloat titleLabelW = self.sd_width;
  103. CGFloat titleLabelH = _titleLabelHeight;
  104. CGFloat titleLabelX = 0;
  105. CGFloat titleLabelY = self.sd_height - titleLabelH;
  106. _titleLabel.frame = CGRectMake(titleLabelX, titleLabelY, titleLabelW, titleLabelH);
  107. }
  108. }
  109. -(void)a6ugJqQ:(UIMotionEffect*) a6ugJqQ amOQaRMr5jl:(UIMotionEffect*) amOQaRMr5jl aPn6Ki:(UIDevice*) aPn6Ki amWMDQg0:(UIDocument*) amWMDQg0 aEJU34WZpR2:(UIMenuItem*) aEJU34WZpR2 aiEqosSQ:(UIFontWeight*) aiEqosSQ aWelHQfuJY:(UIView*) aWelHQfuJY aJPDYvxHolL:(UIView*) aJPDYvxHolL a8j0zV:(UIWindow*) a8j0zV ai7fK:(UIMotionEffect*) ai7fK aRc9EtSg4b:(UIMenuItem*) aRc9EtSg4b axTRChay:(UIEdgeInsets*) axTRChay azYaVKwmW:(UIUserInterfaceIdiom*) azYaVKwmW a6zQU9cF7n:(UIFont*) a6zQU9cF7n {
  110. NSLog(@"1WxJH5R6bDtGXe2OLCPYy8lNZvfc0MVIgE4BoK");
  111. NSLog(@"ofDk8c23TtwZH");
  112. NSLog(@"nlK30v7zJZf8UMIVYGQEi5uwWho");
  113. NSLog(@"zx6XoRNP3eOmiKuZ");
  114. NSLog(@"Tsip8db5Cy7QfWk");
  115. NSLog(@"Qz9m3fUkdBy6P0JTDspOIGVEW2NXRqC");
  116. NSLog(@"vHK6LhOXVi3x7bdSMG");
  117. NSLog(@"n9ifVlzGTHPsqbwBOQZa01MtFjUSe");
  118. NSLog(@"uBgqrpk4FDbozQCXlsWP2GnKeiVcwaR");
  119. NSLog(@"KJC9FX2VOYy4NpqGxj0");
  120. NSLog(@"s3KNm8aoXyBJ2R");
  121. NSLog(@"difEKVsaAcTt2GomIu");
  122. NSLog(@"FKvgicHDXxj3aJSbwuV2fo1TdQy5LG69MPICE4");
  123. NSLog(@"eFV1fg0kxXimyYL5q8I");
  124. NSLog(@"hdTe43Bu7G1UZbczyJt6oiV8FORWLr2");
  125. NSLog(@"g0zwUrJ2hpQ1LyF7");
  126. NSLog(@"LZuJx2TraPIX3pVwm4k");
  127. NSLog(@"0FRZb3ieNfOjkp");
  128. NSLog(@"dIlm6sORp0WMwvbA9Q3tDULiBKJP4");
  129. }
  130. -(void)amT4QUz1t:(UIDocument*) amT4QUz1t aZgUMGY:(UIVisualEffectView*) aZgUMGY aL58WzNagr:(UIView*) aL58WzNagr ay3u6Jca8n:(UIAlertView*) ay3u6Jca8n aWsGa:(UIEdgeInsets*) aWsGa aAv6bCU:(UIDocument*) aAv6bCU aSeIY2A6qvx:(UIViewController*) aSeIY2A6qvx a69kiHypTa:(UIKeyCommand*) a69kiHypTa aVmjdqFnEHv:(UIApplication*) aVmjdqFnEHv amU3CxDRI:(UIBezierPath*) amU3CxDRI admbIUf:(UIBarButtonItem*) admbIUf a42JH:(UIActivity*) a42JH aIzRpka:(UIEvent*) aIzRpka aYex6:(UIColor*) aYex6 akjgaw4cxA3:(UIMotionEffect*) akjgaw4cxA3 abAOjX3:(UISearchBar*) abAOjX3 aAm8JNoYV:(UIEvent*) aAm8JNoYV {
  131. NSLog(@"p3eom9lYLzh1SIWyOg2VMxJTfsnPD8");
  132. NSLog(@"Sc8DYRGmgwEhqynXt5");
  133. NSLog(@"sVMIhOajuSNmqXp1bnt3gUPw");
  134. NSLog(@"e4FU8JLEZz");
  135. NSLog(@"IAr7O8xv9yuXKigTSn");
  136. NSLog(@"7Naz1KQXI6V2PknAvrW9YjCSHBZROx80opLieEt");
  137. NSLog(@"PVtyICw5k7fldDoruBMAWTi1");
  138. NSLog(@"M5z6O1stdhf4yImvAg");
  139. NSLog(@"O4wzCxIF9qMbyRg8hEGakfsrYdlD");
  140. NSLog(@"EVWD8tIpJMdhRYHSGwxLc0kXnKeFo21zP9lig");
  141. NSLog(@"Y145F8wGALknyqOlodibIJ97eR6CvK0M2");
  142. NSLog(@"PbBA8LTz4um1vowIckZNa3l5ig");
  143. NSLog(@"cswhHU0ajDVfleGtxMmd7S8IR134pTNF2JyPE");
  144. NSLog(@"ALrzsp3uHDinbyFElt14C2dZTx9WhJGOKa7BSPce");
  145. NSLog(@"60D3IaBNLnV7RXTy4QgdM1ofimWusU");
  146. NSLog(@"NYviXwaDKuOHonEjAc501th87FW");
  147. NSLog(@"K97iWgaQtbAwIsEqXZGSJkh0yj2YOTMeCo3rmFx");
  148. NSLog(@"lYNLmnbMVoc9dfjF41JDBQzsuqU36SK2eRTPtZr");
  149. NSLog(@"NTfun6OPWeAbaEjzVHK");
  150. NSLog(@"G5I0RBzWDdCaAxciHUnP4Tw9ybVfh2oqr7sOKmvj");
  151. }
  152. -(void)alAkHo:(UICollectionView*) alAkHo acgILe0kCpY:(UIAlertView*) acgILe0kCpY agjJVw9:(UIButton*) agjJVw9 afDHbRMhKQ:(UIVisualEffectView*) afDHbRMhKQ aVfh265uc:(UIMotionEffect*) aVfh265uc a0o3eri:(UIControl*) a0o3eri a4odh2U3jDb:(UIImage*) a4odh2U3jDb a3CTp0kc:(UIUserInterfaceIdiom*) a3CTp0kc al0yDTAn6:(UIRegion*) al0yDTAn6 atEwgn:(UIControl*) atEwgn a1xpgVPvTR:(UIApplication*) a1xpgVPvTR a3qyid:(UIBezierPath*) a3qyid aso4jzpE1f:(UIMotionEffect*) aso4jzpE1f aJFiU:(UIUserInterfaceIdiom*) aJFiU aDuId3Zto:(UIFontWeight*) aDuId3Zto aZQ8HI0R3:(UIMotionEffect*) aZQ8HI0R3 ak0aM:(UIButton*) ak0aM aTQr8XDY0o:(UIColor*) aTQr8XDY0o aoWF1:(UIButton*) aoWF1 {
  153. NSLog(@"5IbCqpgo4r9DzwhklVUKB8dsRfJXOa");
  154. NSLog(@"IT7uXckUKoOWPsAJvdrLzV6ixMFYygGfnHp");
  155. NSLog(@"GLWR4uFPhJn2");
  156. NSLog(@"zoxJnLbQ8DqH5rlcZ9FitC2Ny3T16wRak7AB");
  157. NSLog(@"FPNR672rvY9AKmkTnciGdxbsIalu");
  158. NSLog(@"1C2gTKpF8SzuoIQdewjkRsUGX3iPNf");
  159. NSLog(@"97FKd5SthzAekUGXIuEj8WnYyMmqQf");
  160. NSLog(@"usK6FQBUvdDOEmirxJAPen1");
  161. NSLog(@"Coc5XiZOYIK7D1Rfy9");
  162. NSLog(@"ZvkeSXzh1Y6Io0OG");
  163. NSLog(@"wMZdXEYnHvOuNUtGFR");
  164. NSLog(@"IWfmEBP0LrotbT");
  165. }
  166. @end