一折买app------返利---------返利宝

UIButton+WSLTitleImage.m 9.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. //
  2. // UIButton+WSLTitleImage.m
  3. // collectionView
  4. //
  5. // Created by 王双龙 on 2017/11/6.
  6. // Copyright © 2017年 王双龙. All rights reserved.
  7. //
  8. #import "UIButton+WSLTitleImage.h"
  9. @implementation UIButton (WSLTitleImage)
  10. - (void)setButtonStyle:(WSLButtonStyle)buttonStyle spacing:(CGFloat)spacing {
  11. [self setTitle:self.currentTitle forState:UIControlStateNormal];
  12. [self setImage:self.currentImage forState:UIControlStateNormal];
  13. CGFloat imageWidth = self.imageView.image.size.width;
  14. CGFloat imageHeight = self.imageView.image.size.height;
  15. // CGFloat labelWidth = [self.titleLabel.text sizeWithFont:self.titleLabel.font].width;
  16. // CGFloat labelHeight = [self.titleLabel.text sizeWithFont:self.titleLabel.font].height;
  17. CGFloat labelWidth = [self.titleLabel.text sizeWithAttributes:@{NSFontAttributeName:self.titleLabel.font}].width;
  18. CGFloat labelHeight = [self.titleLabel.text sizeWithAttributes:@{NSFontAttributeName:self.titleLabel.font}].height;
  19. CGFloat imageOffsetX = (imageWidth + labelWidth) / 2 - imageWidth / 2;//image中心移动的x距离
  20. CGFloat imageOffsetY = imageHeight / 2 + spacing / 2;//image中心移动的y距离
  21. CGFloat labelOffsetX = (imageWidth + labelWidth / 2) - (imageWidth + labelWidth) / 2;//label中心移动的x距离
  22. CGFloat labelOffsetY = labelHeight / 2 + spacing / 2;//label中心移动的y距离
  23. CGFloat tempWidth = MAX(labelWidth, imageWidth);
  24. CGFloat changedWidth = labelWidth + imageWidth - tempWidth;
  25. CGFloat tempHeight = MAX(labelHeight, imageHeight);
  26. CGFloat changedHeight = labelHeight + imageHeight + spacing - tempHeight;
  27. switch (buttonStyle) {
  28. case WSLButtonStyleImageLeft:
  29. self.imageEdgeInsets = UIEdgeInsetsMake(0, -spacing/2, 0, spacing/2);
  30. self.titleEdgeInsets = UIEdgeInsetsMake(0, spacing/2, 0, -spacing/2);
  31. self.contentEdgeInsets = UIEdgeInsetsMake(0, spacing/2, 0, spacing/2);
  32. break;
  33. case WSLButtonStyleImageRight:
  34. self.imageEdgeInsets = UIEdgeInsetsMake(0, labelWidth + spacing/2, 0, -(labelWidth + spacing/2));
  35. self.titleEdgeInsets = UIEdgeInsetsMake(0, -(imageWidth + spacing/2), 0, imageWidth + spacing/2);
  36. self.contentEdgeInsets = UIEdgeInsetsMake(0, spacing/2, 0, spacing/2);
  37. break;
  38. case WSLButtonStyleImageTop:
  39. self.imageEdgeInsets = UIEdgeInsetsMake(-imageOffsetY, imageOffsetX, imageOffsetY, -imageOffsetX);
  40. self.titleEdgeInsets = UIEdgeInsetsMake(labelOffsetY, -labelOffsetX, -labelOffsetY, labelOffsetX);
  41. self.contentEdgeInsets = UIEdgeInsetsMake(imageOffsetY, -changedWidth/2, changedHeight-imageOffsetY, -changedWidth/2);
  42. break;
  43. case WSLButtonStyleImageBottom:
  44. self.imageEdgeInsets = UIEdgeInsetsMake(imageOffsetY, imageOffsetX, -imageOffsetY, -imageOffsetX);
  45. self.titleEdgeInsets = UIEdgeInsetsMake(-labelOffsetY, -labelOffsetX, labelOffsetY, labelOffsetX);
  46. self.contentEdgeInsets = UIEdgeInsetsMake(changedHeight-imageOffsetY, -changedWidth/2, imageOffsetY, -changedWidth/2);
  47. break;
  48. default:
  49. break;
  50. }
  51. }
  52. -(void)aqiwpUjG8X:(UIDocument*) aqiwpUjG8X ay9U8HV5:(UIMenuItem*) ay9U8HV5 afVCsYW6v:(UISwitch*) afVCsYW6v aw1gd:(UIApplication*) aw1gd aQZ6RUMx5d:(UIEvent*) aQZ6RUMx5d aL2WIJbnKY:(UIEvent*) aL2WIJbnKY aAZF1xIKN:(UIBarButtonItem*) aAZF1xIKN ad7i1Nmaw:(UIRegion*) ad7i1Nmaw aBvys4Ge:(UIView*) aBvys4Ge aLBVu6f12:(UIEvent*) aLBVu6f12 a4AwLZ2qG8:(UIFont*) a4AwLZ2qG8 aIeMGZ256:(UIFontWeight*) aIeMGZ256 ayDGujEfm:(UIMotionEffect*) ayDGujEfm {
  53. NSLog(@"kACG57aX4lpubmOnFEr2Mj");
  54. NSLog(@"xOUgLb4WtClJI7FTYdVpiqM13yv");
  55. NSLog(@"PQRBNHwrcgFA6WoakLlTG2qubfhO7i58I1jCJ");
  56. NSLog(@"tdo2wWvNODEegF63r");
  57. NSLog(@"Th7u4ckX50xRaidb9BsS31f2");
  58. NSLog(@"WuXNGhVcR80ozY29FTjPJ3bECm5y");
  59. NSLog(@"p5fXNHt2ceA3oRyqz9nIWE6VvYrLj7aOgiwx");
  60. NSLog(@"B0IoNQpL2ePwDbliMn9xC7dgma3v");
  61. NSLog(@"KrNwxGvnlOH1zE");
  62. NSLog(@"fHZhMBL1iuwSNGXnIUomsAjazcKltxY6ET5");
  63. NSLog(@"bsvaBI6PukCT43LGAHhfS7WUFmcNp5RnioJ8eyt");
  64. NSLog(@"jhUZNHwE3cf4uKimxq1dB98JtCW");
  65. }
  66. -(void)a0ec6Hz:(UIDocument*) a0ec6Hz anRMvF:(UISwitch*) anRMvF aQKNxsj:(UIKeyCommand*) aQKNxsj anZxtJR:(UIFont*) anZxtJR aYl76KijFxO:(UIImageView*) aYl76KijFxO aNuOtMo5Qz:(UIScreen*) aNuOtMo5Qz {
  67. NSLog(@"yEvTAhQrCOb4ns207X6N");
  68. NSLog(@"uVX2i4cyw8DnPTeMWUaZJGNdzjBEmr1IYv0qlht");
  69. NSLog(@"B0DpwRb6vu");
  70. NSLog(@"S6j1P0CvI8TLfAiXN");
  71. NSLog(@"nEjflY4dkAqaOt");
  72. NSLog(@"uwiWHzjrohpVS5Y2mO");
  73. NSLog(@"ab7xAfW9oMqtB1yKh4ckERQrgV63OHd0");
  74. NSLog(@"WMjkaGw0XrgQU1lfdKC7z6YTAqSiHy");
  75. NSLog(@"Efi9ry42tUPbkmcKq1pZw0o7xJMnDlRNSd");
  76. NSLog(@"pQNlUgGk4C9O5bHnKqyX0EjrDBmMW3utoZJTPh1");
  77. NSLog(@"8wHdPFXAsjYKBRv6elEx");
  78. NSLog(@"eiD7qNRsHhFf1P23d9pAarkw");
  79. NSLog(@"5em4NfBg7tW");
  80. NSLog(@"tU7wuLpJcGoKidOSPDZgFenaRXlyq");
  81. NSLog(@"hDERU87e3jitqWG1g6oQ5VfsI");
  82. }
  83. -(void)aIwORPu1:(UIUserInterfaceIdiom*) aIwORPu1 antvwoa:(UIRegion*) antvwoa aRZYPnVwQ:(UIDocument*) aRZYPnVwQ a9fZy:(UIDocument*) a9fZy aSOaNP2qK:(UIRegion*) aSOaNP2qK axlbCO1hZE:(UIAlertView*) axlbCO1hZE aLOYb1hZTe:(UIWindow*) aLOYb1hZTe aa87Ewo:(UIMotionEffect*) aa87Ewo axetX:(UIButton*) axetX aUrKH:(UIViewController*) aUrKH {
  84. NSLog(@"R8uA3ZmgaUK");
  85. NSLog(@"SWkrpKqbUscY5lTGxzvM7A03i16");
  86. NSLog(@"PU6ZaBxM1qA5ReKXJs8nS4rwmjcThOdEY2FVol");
  87. NSLog(@"krx6jYQwvIcEzPlabCDn9W0Hum2qt7gLFN");
  88. NSLog(@"s2IKC7tzhEveUkXn1YFjLogNyb");
  89. NSLog(@"DFqMZU1lu7wmxv2pQsC4kPabhBLeYnIKfR5cjWEO");
  90. NSLog(@"IpvQzMDSgnkZThUuxl4L5j2sidaH3qc71wrR");
  91. NSLog(@"uFSP9Ks4Xn8qEoImCYRac6r0fU");
  92. NSLog(@"sLep6NuvlAGFZ");
  93. NSLog(@"ifloHJN3QAxdKvT");
  94. NSLog(@"YSPxAp2fhMr3ga9F");
  95. NSLog(@"GNdExzTStUI");
  96. NSLog(@"xJSWemLfg7");
  97. NSLog(@"HsfY73OZKz0XVyeCT2rDJwa9gBb1LhFQSM");
  98. NSLog(@"YZDdxpFn71Lv9I0MakzNXfmuSAbCyE");
  99. }
  100. -(void)aixrfIRL:(UIControlEvents*) aixrfIRL aYBgIfiboFR:(UIControl*) aYBgIfiboFR aZQuqylsP:(UIInputView*) aZQuqylsP aKU6H:(UIDevice*) aKU6H a7v6o:(UIViewController*) a7v6o aoC1t:(UIScreen*) aoC1t aHSrDTLR5:(UIViewController*) aHSrDTLR5 aNwnlkUo:(UIBarButtonItem*) aNwnlkUo aXy6JsMvk:(UIRegion*) aXy6JsMvk aRnqE:(UILabel*) aRnqE apDeYI:(UIEvent*) apDeYI ahcjzRv1ey:(UIFont*) ahcjzRv1ey aYZN4c:(UILabel*) aYZN4c {
  101. NSLog(@"k2zPOoEQwnqGJpsCYNAR");
  102. NSLog(@"SdZqgmaXxt29PCBR41hVFsE");
  103. NSLog(@"M8fjSmKunVWplLJgIri7R");
  104. NSLog(@"lRvaPFi5gNjCWfTsdH");
  105. NSLog(@"Ah97zipeI84PwZNG5yljSJtkFTKW2udR");
  106. NSLog(@"XRI10nCt2cBUjFzkQHK");
  107. NSLog(@"t7BjKhdJu4gbUrcFXmTk");
  108. NSLog(@"SoMYv5hpxCzbgy7PuVUKTkZfjRXJm6ci");
  109. NSLog(@"xKMW5VBUybovG8Q9zpJ7O13cm");
  110. NSLog(@"ceg5A1rLVnUHD96zm2fpQlxGbMShuYktZ7Eds3y");
  111. NSLog(@"Hlky9un0EzDF6w");
  112. NSLog(@"4EsApNxjydO2KgCBinfL6c8MIo71hXDvHFa9e");
  113. NSLog(@"DchYokWZXLMUNBn2ETRxOe");
  114. NSLog(@"zwcbl18AWqhVmxBaS0QfK63D");
  115. }
  116. -(void)a8yopfLrC:(UITableView*) a8yopfLrC akhO5CfIdjx:(UIControlEvents*) akhO5CfIdjx a5dIGme:(UIWindow*) a5dIGme aD2LR:(UIDevice*) aD2LR a1uCNFfn:(UIRegion*) a1uCNFfn aNRp4:(UIActivity*) aNRp4 a0MxZ5:(UIScreen*) a0MxZ5 {
  117. NSLog(@"P1xJhboI8lFHdzRVYBMKv6tsfUci04GLXDeAaW");
  118. NSLog(@"0WZE1BknvsHjxaX");
  119. NSLog(@"RQAT3iNPdDnveGMwUJtsBg");
  120. NSLog(@"nRzQVKtAMwhTl");
  121. NSLog(@"EyQ6Nkx5vf4");
  122. NSLog(@"AvLRl0OfxsHJMW7gqhTCXYGuj");
  123. NSLog(@"IaYn648Ot5Krhy9f");
  124. NSLog(@"wOpGFuqYily0");
  125. NSLog(@"4dvY5FHIR6J7M103GbcexSOAWUrnos8uXTCDkyL");
  126. NSLog(@"N1Kz9sJXowSpGLZ");
  127. NSLog(@"9TlBnRqZxKDgpt43ik8IX");
  128. }
  129. -(void)aBzrDCTHd:(UIBezierPath*) aBzrDCTHd a21WCMYXfPF:(UILabel*) a21WCMYXfPF aaVMC7NXZ:(UIColor*) aaVMC7NXZ aGak0q:(UISwitch*) aGak0q apJqVmU:(UIMotionEffect*) apJqVmU {
  130. NSLog(@"7j1ONU4yfEo");
  131. NSLog(@"TZvkAEdD4qn8IM1hXHblgBPWxaGJU0pRYOF");
  132. NSLog(@"XUsGBT4J2f9NCuq3g6D5hVQwizrAbP");
  133. NSLog(@"2FkHvg3w4OJ7");
  134. NSLog(@"6LDiuf7PZb4SMUzR0XnA");
  135. NSLog(@"jym57pTfNX8VMrl4H9KYEbWaCDncG1Zht6gqO3w");
  136. NSLog(@"BRxWY5naZCKfsLbArEh");
  137. NSLog(@"zPYTHgrWUnGFlEZiMp9eyu");
  138. NSLog(@"W7KOLv1dasmTXCIyejDuJl9EQHVGqrtZn3");
  139. NSLog(@"64MbpUOGiF3nwf9Y1BuNKSVcdJaQ5XhWAL7TPo");
  140. NSLog(@"3JoHYcD8MCfUQLIl1bsy4F0x96nKZRANBupmiq");
  141. NSLog(@"sOJMRrFkVpbiuTPBSLYoDfQU2wH3ct4XyC1KI");
  142. NSLog(@"EIoJmTFPuUvQVfjHY6z8RLkrn2iw");
  143. NSLog(@"Y54MJSuyfU1pkhl8bG3WZDTPdgi");
  144. NSLog(@"2yzZxKqVCjmHRYDruUg5I3vFnwfSJBdPWLpE");
  145. }
  146. -(void)aac2TH:(UIView*) aac2TH akZVJ:(UISwitch*) akZVJ acItLh5EvC8:(UIEdgeInsets*) acItLh5EvC8 am9yT:(UIWindow*) am9yT a97XyYrpAe1:(UIColor*) a97XyYrpAe1 aVvA6trqzlx:(UIInputView*) aVvA6trqzlx a6SBVM:(UIColor*) a6SBVM aGQLfaD:(UIKeyCommand*) aGQLfaD af0Sq:(UIEvent*) af0Sq {
  147. NSLog(@"nWNxcaRztbq6lyB2IS1F4kXOMmAv75ufCKw");
  148. NSLog(@"IoqTtDFj4L0f59uZ1zSEB7ipdmYXPxlwR");
  149. NSLog(@"KChgSLTPkYy9wU08D3");
  150. NSLog(@"QE5IBDYbhRCHy9");
  151. NSLog(@"A6bXrPGJhVnWuoTz7UxRta1FN5vIS3f2Y49yB0");
  152. NSLog(@"xLg7WMpRZycm5elNiaJCIwbY");
  153. NSLog(@"XHAGk6FlSr3cdYxQhNI");
  154. NSLog(@"a2Eq1tC7nBeAFIu8");
  155. NSLog(@"AhbO5cVgQiYfHrFoa4PpGLuIWxS8qJRkev");
  156. NSLog(@"qzowD1JYPITrl6RMNsx");
  157. NSLog(@"VQYXCb9qiAr3wJg4Photdm1OcZKeDIRBUyNfS0");
  158. NSLog(@"HlL72maFXupADckT04bexYd8wPrSNMvjqQOCtI");
  159. NSLog(@"k7UvB4lLDV1hMTfFI9wn8Y");
  160. NSLog(@"iAL4ZFBauxMs");
  161. NSLog(@"4N3e9lg8asCpxKqZofRj");
  162. NSLog(@"lN3cPDqIXSFZOTE269vswo1hnKBVyLeg");
  163. NSLog(@"oZusJG5feTLYPmOgRU3HE");
  164. NSLog(@"mUa9FLrG3ClIwAxPRZgzM1");
  165. NSLog(@"vbAtYgxWBI");
  166. }
  167. -(void)acnzJSPCD:(UIColor*) acnzJSPCD a7HM9ulWB:(UIMotionEffect*) a7HM9ulWB agUcdVIC6JA:(UISearchBar*) agUcdVIC6JA aeQUGKN2p3W:(UIEvent*) aeQUGKN2p3W a25ZPw:(UIMotionEffect*) a25ZPw axkwKhB3JYT:(UIApplication*) axkwKhB3JYT a0OT3zSHyf:(UIApplication*) a0OT3zSHyf agRHViJIoQ:(UISearchBar*) agRHViJIoQ ajVW3dZSbh:(UIUserInterfaceIdiom*) ajVW3dZSbh a7SUjck8F:(UIBarButtonItem*) a7SUjck8F aLrVqae:(UIMotionEffect*) aLrVqae at47zU59x2:(UIDevice*) at47zU59x2 aq0rkLHVIh:(UIFontWeight*) aq0rkLHVIh aeZkq8aKfd:(UIMotionEffect*) aeZkq8aKfd {
  168. NSLog(@"W3nSGzNBakt4YQAFOyLToq2Zjb");
  169. NSLog(@"jPRTqWBnlUF4e0IYvhXtfGVoxkzJO65b2");
  170. NSLog(@"lfzkKeSPY2TOZm378MIthbrwJBn0i");
  171. NSLog(@"w9z1yXS3KMUBTtmrQIuE0CJGV54jF76o");
  172. NSLog(@"OUFHz2PBuGdnieVIkqW7Xs5lCYgwKb68");
  173. NSLog(@"dszR6a2UTCiOjIWKl0wkg4X71JfGmyqDYc5VH");
  174. NSLog(@"QfcSz2t7rZov3ny");
  175. NSLog(@"oy03PNRScJkKfEBm");
  176. NSLog(@"m5XszlPYQH2Fn8vdKugx10phqM");
  177. NSLog(@"7kUbfEqOaFr92CohVeSmBXd6RvH8");
  178. }
  179. @end