mySetHeadView.m 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. //
  2. // mySetHeadView.m
  3. // 隐私保护
  4. //
  5. // Created by xd h on 2023/11/9.
  6. //
  7. #import "mySetHeadView.h"
  8. @interface mySetHeadView ()
  9. {
  10. UIView *imageBackupsBgView;
  11. UILabel *imageBackupsLabel;
  12. UIButton *imageBackupsButton;
  13. }
  14. @end
  15. @implementation mySetHeadView
  16. - (id)initWithFrame:(CGRect)frame{
  17. self = [super initWithFrame:frame];
  18. [self drawAnyView];
  19. return self;
  20. }
  21. - (void)drawAnyView{
  22. [self setBackgroundColor:[UIColor hwColor:@"#F5F7FA" alpha:1.0]];
  23. //self.backgroundColor = [UIColor redColor];
  24. //setting_Privacy_bg
  25. UIImageView *PrivacyBg = [[UIImageView alloc] init];
  26. PrivacyBg.image = [UIImage imageNamed:@"setting_Privacy_bg"];
  27. //PrivacyBg.contentMode = UIViewContentModeScaleAspectFit;
  28. PrivacyBg.userInteractionEnabled = YES;
  29. [self addSubview:PrivacyBg];
  30. //PrivacyBg.backgroundColor = [UIColor greenColor];
  31. CGFloat PrivacyBgW = SCREEN_W - 20;
  32. CGFloat PrivacyBgH = 116.0 * PrivacyBgW / (345.0);
  33. [PrivacyBg mas_makeConstraints:^(MASConstraintMaker *make) {
  34. make.left.mas_equalTo(10);
  35. make.top.mas_equalTo(10);
  36. make.width.mas_equalTo(PrivacyBgW);
  37. make.height.mas_equalTo(PrivacyBgH);
  38. }];
  39. UILabel *PrivacyTitleLabel = [[UILabel alloc] init];
  40. PrivacyTitleLabel.text = NSLocalizedString(@"my_set_Privacy_Model",nil) ;
  41. PrivacyTitleLabel.font = [UIFont boldSystemFontOfSize:16.0];
  42. PrivacyTitleLabel.textColor = [UIColor hwColor:@"0A132B" alpha:1.0];
  43. [PrivacyBg addSubview:PrivacyTitleLabel];
  44. [PrivacyTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  45. make.left.mas_equalTo(10);
  46. make.top.mas_equalTo(15);
  47. make.width.mas_equalTo(150);
  48. make.height.mas_equalTo(20);
  49. }];
  50. UIButton *setPrivacyBut = [[UIButton alloc] init];
  51. // gradient
  52. CAGradientLayer *gl = [CAGradientLayer layer];
  53. gl.frame = CGRectMake(0,0,80.f,32.f);
  54. gl.startPoint = CGPointMake(0, 0.5);
  55. gl.endPoint = CGPointMake(1, 0.5);
  56. gl.colors = @[(__bridge id)HW0CDEFDColor.CGColor, (__bridge id)HW058DFBColor.CGColor];
  57. gl.locations = @[@(0), @(1.0f)];
  58. [setPrivacyBut.layer addSublayer:gl];
  59. setPrivacyBut.tag = 4;
  60. [setPrivacyBut addTarget:self action:@selector(didClickButFun:) forControlEvents:UIControlEventTouchUpInside];
  61. setPrivacyBut.layer.cornerRadius = 16.0;
  62. setPrivacyBut.layer.masksToBounds = YES;
  63. [setPrivacyBut setTitle:NSLocalizedString(@"set_Privacy_button_title",nil) forState:UIControlStateNormal];
  64. setPrivacyBut.titleLabel.font = [UIFont systemFontOfSize:12.0];
  65. [PrivacyBg addSubview:setPrivacyBut];
  66. [setPrivacyBut mas_makeConstraints:^(MASConstraintMaker *make) {
  67. make.right.mas_equalTo(-10);
  68. make.top.mas_equalTo(10);
  69. make.width.mas_equalTo(80);
  70. make.height.mas_equalTo(32);
  71. }];
  72. UILabel *PrivacyTipLabel = [[UILabel alloc] init];
  73. PrivacyTipLabel.text = NSLocalizedString(@"set_Privacy_Tip",nil) ;
  74. PrivacyTipLabel.font = [UIFont systemFontOfSize:14.0];
  75. PrivacyTipLabel.textColor = [UIColor hwColor:@"#01B7EA" alpha:1.0];
  76. [PrivacyBg addSubview:PrivacyTipLabel];
  77. [PrivacyTipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  78. make.left.mas_equalTo(10);
  79. make.top.mas_equalTo(PrivacyTitleLabel.mas_bottom).offset(10);
  80. make.right.mas_equalTo(0);
  81. make.height.mas_equalTo(20);
  82. }];
  83. UILabel *PrivacyTipLabel2 = [[UILabel alloc] init];
  84. PrivacyTipLabel2.text = NSLocalizedString(@"my_set_Privacy_Mode_tip1",nil) ;
  85. PrivacyTipLabel2.font = [UIFont systemFontOfSize:12.0];
  86. PrivacyTipLabel2.textColor = [UIColor hwColor:@"#6A6A6A" alpha:1.0];
  87. PrivacyTipLabel2.numberOfLines = 0;
  88. [PrivacyBg addSubview:PrivacyTipLabel2];
  89. [PrivacyTipLabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
  90. make.left.mas_equalTo(10);
  91. make.top.mas_equalTo(PrivacyTipLabel.mas_bottom).offset(10);
  92. make.right.mas_equalTo(-10);
  93. make.height.mas_equalTo(40);
  94. }];
  95. //文件上传
  96. UIView *fileUploadBgView = [[UIView alloc] init];
  97. fileUploadBgView.backgroundColor = [UIColor whiteColor];
  98. fileUploadBgView.layer.cornerRadius = 8;
  99. [self addSubview:fileUploadBgView];
  100. [fileUploadBgView mas_makeConstraints:^(MASConstraintMaker *make) {
  101. make.left.mas_equalTo(10);
  102. make.top.mas_equalTo(PrivacyBg.mas_bottom).offset(15);
  103. make.right.mas_equalTo(-10);
  104. make.height.mas_equalTo(110);
  105. }];
  106. UILabel *titleLabel = [[UILabel alloc] init];
  107. titleLabel.text = NSLocalizedString(@"my_set_no_File_upload_title",nil) ;
  108. titleLabel.font = [UIFont boldSystemFontOfSize:16.0];
  109. [fileUploadBgView addSubview:titleLabel];
  110. [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  111. make.left.mas_equalTo(10);
  112. make.top.mas_equalTo(10);
  113. make.width.mas_equalTo(100);
  114. make.height.mas_equalTo(20);
  115. }];
  116. //上传记录
  117. UIImageView *arrowImageView = [[UIImageView alloc] init];
  118. arrowImageView.image = [UIImage imageNamed:@"cell_right_access"];
  119. [fileUploadBgView addSubview:arrowImageView];
  120. [arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
  121. make.right.mas_equalTo(-10);
  122. make.top.mas_equalTo(10);
  123. make.width.mas_equalTo(20);
  124. make.height.mas_equalTo(20);
  125. }];
  126. UILabel *rightLabel = [[UILabel alloc] init];
  127. rightLabel.text = NSLocalizedString(@"set_upload_download_tip",nil) ;
  128. rightLabel.font = [UIFont systemFontOfSize:14.0];
  129. rightLabel.textColor = [UIColor hwColor:@"#959799" alpha:1.0];
  130. rightLabel.textAlignment = NSTextAlignmentRight;
  131. [fileUploadBgView addSubview:rightLabel];
  132. [rightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  133. make.right.mas_equalTo(arrowImageView.mas_left).offset(-2);
  134. make.top.mas_equalTo(10);
  135. make.width.mas_equalTo(200);
  136. make.height.mas_equalTo(20);
  137. }];
  138. UIButton *recordBut = [[UIButton alloc] init];
  139. //recordBut.backgroundColor = [UIColor greenColor];
  140. recordBut.tag = 1;
  141. [recordBut addTarget:self action:@selector(didClickButFun:) forControlEvents:UIControlEventTouchUpInside];
  142. [fileUploadBgView addSubview:recordBut];
  143. [recordBut mas_makeConstraints:^(MASConstraintMaker *make) {
  144. make.right.mas_equalTo(0);
  145. make.top.mas_equalTo(0);
  146. make.width.mas_equalTo(150);
  147. make.height.mas_equalTo(40);
  148. }];
  149. //图片上传
  150. NSString* curImgUploadStr = [[NSString alloc] initWithFormat:@"%@ %@",@" ",NSLocalizedString(@"my_set_no_image_upload",nil)];
  151. UIButton *imageUploadBut = [[UIButton alloc] init];
  152. [imageUploadBut setImage:[UIImage imageNamed:@"icon_image_upload"] forState:UIControlStateNormal];
  153. [imageUploadBut setTitle:curImgUploadStr forState:UIControlStateNormal];
  154. imageUploadBut.backgroundColor = [UIColor hwColor:@"#00D1C1" alpha:0.1];
  155. imageUploadBut.layer.cornerRadius = 4;
  156. [imageUploadBut setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  157. imageUploadBut.titleLabel.font = [UIFont systemFontOfSize:13.0];
  158. imageUploadBut.tag = 2;
  159. [imageUploadBut addTarget:self action:@selector(didClickButFun:) forControlEvents:UIControlEventTouchUpInside];
  160. [fileUploadBgView addSubview:imageUploadBut];
  161. [imageUploadBut mas_makeConstraints:^(MASConstraintMaker *make) {
  162. make.left.mas_equalTo(10);
  163. make.right.mas_equalTo(self.mas_centerX).offset(-10);
  164. make.bottom.mas_equalTo(-10);
  165. make.height.mas_equalTo(48);
  166. }];
  167. //视频上传
  168. NSString* curVidelUploadStr = [[NSString alloc] initWithFormat:@"%@ %@",@" ",NSLocalizedString(@"my_set_no_video_upload",nil)];
  169. UIButton *videoUploadBut = [[UIButton alloc] init];
  170. [videoUploadBut setImage:[UIImage imageNamed:@"icon_video_upload"] forState:UIControlStateNormal];
  171. [videoUploadBut setTitle:curVidelUploadStr forState:UIControlStateNormal];
  172. videoUploadBut.backgroundColor = [UIColor hwColor:@"#00D8FF" alpha:0.1];
  173. videoUploadBut.layer.cornerRadius = 4;
  174. [videoUploadBut setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  175. videoUploadBut.titleLabel.font = [UIFont systemFontOfSize:13.0];
  176. videoUploadBut.tag = 3;
  177. [videoUploadBut addTarget:self action:@selector(didClickButFun:) forControlEvents:UIControlEventTouchUpInside];
  178. [fileUploadBgView addSubview:videoUploadBut];
  179. [videoUploadBut mas_makeConstraints:^(MASConstraintMaker *make) {
  180. make.right.mas_equalTo(-10);
  181. make.left.mas_equalTo(self.mas_centerX).offset(10);
  182. make.bottom.mas_equalTo(-10);
  183. make.height.mas_equalTo(48);
  184. }];
  185. //文件备份
  186. UIView *fileBackupsBgView = [[UIView alloc] init];
  187. fileBackupsBgView.backgroundColor = [UIColor whiteColor];
  188. fileBackupsBgView.layer.cornerRadius = 8;
  189. [self addSubview:fileBackupsBgView];
  190. [fileBackupsBgView mas_makeConstraints:^(MASConstraintMaker *make) {
  191. make.left.mas_equalTo(10);
  192. make.top.mas_equalTo(fileUploadBgView.mas_bottom).offset(15);
  193. make.right.mas_equalTo(-10);
  194. make.height.mas_equalTo(110);
  195. }];
  196. UILabel *BackupsTitleLabel = [[UILabel alloc] init];
  197. BackupsTitleLabel.text = NSLocalizedString(@"set_Privacy_title",nil) ;
  198. BackupsTitleLabel.font = [UIFont boldSystemFontOfSize:16.0];
  199. [fileBackupsBgView addSubview:BackupsTitleLabel];
  200. [BackupsTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  201. make.left.mas_equalTo(10);
  202. make.top.mas_equalTo(10);
  203. make.width.mas_equalTo(100);
  204. make.height.mas_equalTo(20);
  205. }];
  206. //
  207. UIImageView *arrowImageView2 = [[UIImageView alloc] init];
  208. arrowImageView2.image = [UIImage imageNamed:@"cell_right_access"];
  209. [fileBackupsBgView addSubview:arrowImageView2];
  210. [arrowImageView2 mas_makeConstraints:^(MASConstraintMaker *make) {
  211. make.right.mas_equalTo(-10);
  212. make.top.mas_equalTo(10);
  213. make.width.mas_equalTo(20);
  214. make.height.mas_equalTo(20);
  215. }];
  216. NSString *BackupsRightTitle = NSLocalizedString(@"set_Privacy_right_tip",nil);
  217. CGFloat BackupsRightW = [BackupsRightTitle boundingRectWithSize:CGSizeMake(200, 20) options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14.0]} context:nil].size.width;
  218. BackupsRightW += 5;
  219. UILabel *BackupsRightLabel = [[UILabel alloc] init];
  220. BackupsRightLabel.text = BackupsRightTitle;
  221. BackupsRightLabel.font = [UIFont systemFontOfSize:14.0];
  222. BackupsRightLabel.textColor = [UIColor hwColor:@"#959799" alpha:1.0];
  223. BackupsRightLabel.textAlignment = NSTextAlignmentRight;
  224. [fileBackupsBgView addSubview:BackupsRightLabel];
  225. [BackupsRightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  226. make.right.mas_equalTo(arrowImageView.mas_left).offset(-2);
  227. make.top.mas_equalTo(10);
  228. make.width.mas_equalTo(BackupsRightW);
  229. make.height.mas_equalTo(20);
  230. }];
  231. UIButton *BackupsSetBut = [[UIButton alloc] init];
  232. //BackupsSetBut.backgroundColor = [UIColor greenColor];
  233. BackupsSetBut.tag = 5;
  234. [BackupsSetBut addTarget:self action:@selector(didClickButFun:) forControlEvents:UIControlEventTouchUpInside];
  235. [fileBackupsBgView addSubview:BackupsSetBut];
  236. [BackupsSetBut mas_makeConstraints:^(MASConstraintMaker *make) {
  237. make.right.mas_equalTo(0);
  238. make.top.mas_equalTo(0);
  239. make.left.mas_equalTo(BackupsRightLabel.mas_left);
  240. make.height.mas_equalTo(40);
  241. }];
  242. UIButton *BackupsEyeBut = [[UIButton alloc] init];
  243. //BackupsEyeBut.backgroundColor = [UIColor greenColor];
  244. [BackupsEyeBut setImage:[UIImage imageNamed:@"common_eye_open"] forState:UIControlStateNormal];
  245. [BackupsEyeBut setImage:[UIImage imageNamed:@"common_eye_close"] forState:UIControlStateSelected];
  246. BackupsEyeBut.tag = 6;
  247. [BackupsEyeBut addTarget:self action:@selector(didClickButFun:) forControlEvents:UIControlEventTouchUpInside];
  248. [fileBackupsBgView addSubview:BackupsEyeBut];
  249. [BackupsEyeBut mas_makeConstraints:^(MASConstraintMaker *make) {
  250. make.right.mas_equalTo(BackupsSetBut.mas_left).offset(0);
  251. make.centerY.mas_equalTo(BackupsRightLabel.mas_centerY);
  252. make.width.mas_equalTo(40);
  253. make.height.mas_equalTo(40);
  254. }];
  255. BackupsEyeBut.hidden = YES;
  256. imageBackupsBgView = [[UIView alloc] init];
  257. imageBackupsBgView.backgroundColor = [UIColor hwColor:@"#F9F9F9" alpha:1.0];
  258. imageBackupsBgView.layer.cornerRadius = 8;
  259. [fileBackupsBgView addSubview:imageBackupsBgView];
  260. [imageBackupsBgView mas_makeConstraints:^(MASConstraintMaker *make) {
  261. make.right.mas_equalTo(-10);
  262. make.left.mas_equalTo(10);
  263. make.bottom.mas_equalTo(-10);
  264. make.height.mas_equalTo(56);
  265. }];
  266. UIImageView *backupsImageV = [[UIImageView alloc] init];
  267. backupsImageV.image = [UIImage imageNamed:@"image_backups_icon"];
  268. [imageBackupsBgView addSubview:backupsImageV];
  269. [backupsImageV mas_makeConstraints:^(MASConstraintMaker *make) {
  270. make.centerY.mas_equalTo(0);
  271. make.left.mas_equalTo(10);
  272. make.width.mas_equalTo(28);
  273. make.height.mas_equalTo(28);
  274. }];
  275. UILabel *imageBackupsTitleLabel = [[UILabel alloc] init];
  276. imageBackupsTitleLabel.text = NSLocalizedString(@"set_Privacy_title_image",nil) ;
  277. imageBackupsTitleLabel.font = [UIFont systemFontOfSize:14.0];
  278. [imageBackupsBgView addSubview:imageBackupsTitleLabel];
  279. [imageBackupsTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  280. make.centerY.mas_equalTo(-10);
  281. make.left.mas_equalTo(backupsImageV.mas_right).offset(10);
  282. make.width.mas_equalTo(100);
  283. make.height.mas_equalTo(20);
  284. }];
  285. UILabel *imageBackupsLabel = [[UILabel alloc] init];
  286. imageBackupsLabel.text = NSLocalizedString(@"set_Privacy_title_image_open",nil) ;
  287. imageBackupsLabel.font = [UIFont systemFontOfSize:12.0];
  288. imageBackupsLabel.textColor = [UIColor hwColor:@"#6A6A6A" alpha:1.0];
  289. [imageBackupsBgView addSubview:imageBackupsLabel];
  290. [imageBackupsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  291. make.centerY.mas_equalTo(10);
  292. make.left.mas_equalTo(backupsImageV.mas_right).offset(10);
  293. make.width.mas_equalTo(100);
  294. make.height.mas_equalTo(20);
  295. }];
  296. UIButton *imageBackupsButton = [[UIButton alloc] init];
  297. imageBackupsButton.backgroundColor = [UIColor hwColor:@"#DCF4FB" alpha:1.0];
  298. imageBackupsButton.tag = 7;
  299. [imageBackupsButton addTarget:self action:@selector(didClickButFun:) forControlEvents:UIControlEventTouchUpInside];
  300. imageBackupsButton.layer.cornerRadius = 12.0;
  301. imageBackupsButton.layer.masksToBounds = YES;
  302. [imageBackupsButton setTitle:NSLocalizedString(@"common_open",nil) forState:UIControlStateNormal];
  303. [imageBackupsButton setTitle:NSLocalizedString(@"common_close",nil) forState:UIControlStateSelected];
  304. [imageBackupsButton setTitleColor:[UIColor hwColor:@"#01B7EA" alpha:1.0] forState:UIControlStateNormal];
  305. imageBackupsButton.titleLabel.font = [UIFont systemFontOfSize:12.0];
  306. [imageBackupsBgView addSubview:imageBackupsButton];
  307. [imageBackupsButton mas_makeConstraints:^(MASConstraintMaker *make) {
  308. make.right.mas_equalTo(-10);
  309. make.centerY.mas_equalTo(0);
  310. make.width.mas_equalTo(60);
  311. make.height.mas_equalTo(24);
  312. }];
  313. //其他功能
  314. UIView *otherBgView = [[UIView alloc] init];
  315. otherBgView.backgroundColor = [UIColor whiteColor];
  316. otherBgView.layer.cornerRadius = 8;
  317. [self addSubview:otherBgView];
  318. [otherBgView mas_makeConstraints:^(MASConstraintMaker *make) {
  319. make.left.mas_equalTo(10);
  320. make.top.mas_equalTo(fileBackupsBgView.mas_bottom).offset(15);
  321. make.right.mas_equalTo(-10);
  322. make.height.mas_equalTo(135);
  323. }];
  324. UILabel *otherTitleLabel = [[UILabel alloc] init];
  325. otherTitleLabel.text = NSLocalizedString(@"set_other_title",nil) ;
  326. otherTitleLabel.font = [UIFont boldSystemFontOfSize:16.0];
  327. [otherBgView addSubview:otherTitleLabel];
  328. [otherTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  329. make.left.mas_equalTo(10);
  330. make.top.mas_equalTo(10);
  331. make.width.mas_equalTo(100);
  332. make.height.mas_equalTo(20);
  333. }];
  334. NSArray *titleArr = @[NSLocalizedString(@"my_set_no_change_phone",nil),
  335. NSLocalizedString(@"my_set_no_restart_phone",nil),
  336. NSLocalizedString(@"my_set_no_Restore_Factory",nil),
  337. NSLocalizedString(@"my_set_no_common_problem",nil),
  338. NSLocalizedString(@"my_set_no_check_update",nil)];
  339. NSArray *imageArr = @[@"icon_change_ohone",@"icon-gengxin",@"icon_Restore_Factory",@"icon_common_problem",@"app_update"];
  340. CGFloat butWidth = (SCREEN_W -20)/titleArr.count;
  341. CGFloat butHeight = 88.0;
  342. for (int i=0; i<titleArr.count; i++) {
  343. UILabel *curlab = [[UILabel alloc] init];
  344. curlab.text = titleArr[i];
  345. curlab.font = [UIFont systemFontOfSize:12.0];
  346. curlab.textColor = [UIColor hwColor:@"#0A132B" alpha:1.0];
  347. curlab.numberOfLines = 0;
  348. curlab.textAlignment = NSTextAlignmentCenter;
  349. [otherBgView addSubview:curlab];
  350. [curlab mas_makeConstraints:^(MASConstraintMaker *make) {
  351. make.left.mas_equalTo(butWidth*i);
  352. make.bottom.mas_equalTo(-10);
  353. make.width.mas_equalTo(butWidth);
  354. make.height.mas_equalTo(30);
  355. }];
  356. UIButton *curImageV = [[UIButton alloc] init];
  357. curImageV.userInteractionEnabled = NO;
  358. [curImageV setImage:[UIImage imageNamed:imageArr[i]] forState:UIControlStateNormal];;
  359. [otherBgView addSubview:curImageV];
  360. [curImageV mas_makeConstraints:^(MASConstraintMaker *make) {
  361. make.left.mas_equalTo(butWidth*i);
  362. make.bottom.mas_equalTo(curlab.mas_top);
  363. make.width.mas_equalTo(butWidth);
  364. make.height.mas_equalTo(40);
  365. }];
  366. UIButton *curButton = [[UIButton alloc] init];
  367. //curButton.backgroundColor = [UIColor greenColor];
  368. curButton.tag = 10 + i;
  369. [curButton addTarget:self action:@selector(didClickButFun:) forControlEvents:UIControlEventTouchUpInside];
  370. //[curButton setTitle:titleArr[i] forState:UIControlStateNormal];
  371. //[curButton setTitleColor:[UIColor hwColor:@"#0A132B" alpha:1.0] forState:UIControlStateNormal];
  372. //[curButton setImage:[UIImage imageNamed:imageArr[i]] forState:UIControlStateNormal];
  373. //curButton.titleLabel.font = [UIFont systemFontOfSize:12.0];
  374. [otherBgView addSubview:curButton];
  375. [curButton mas_makeConstraints:^(MASConstraintMaker *make) {
  376. make.left.mas_equalTo(butWidth*i);
  377. make.bottom.mas_equalTo(0);
  378. make.width.mas_equalTo(butWidth);
  379. make.height.mas_equalTo(butHeight);
  380. }];
  381. }
  382. }
  383. #pragma mark 按钮点击事件
  384. - (void)didClickButFun:(UIButton*)but
  385. {
  386. NSInteger tag = but.tag;
  387. //HLog(@"xxxx:%ld",tag)
  388. if(_didClickBut){
  389. _didClickBut(tag);
  390. }
  391. }
  392. @end