1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- //
- // CCActionSheetCell.m
- // YouHuiProject
- //
- // Created by 小花 on 2018/1/25.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "CCActionSheetCell.h"
- #define kWidth [UIScreen mainScreen].bounds.size.width
- #define kHeight [UIScreen mainScreen].bounds.size.height
- #define ROW_HEIGHT 44
- @implementation CCActionSheetCell
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- // Configure the view for the selected state
- }
- - (void)buildUI{
-
- UILabel *titleLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, kWidth, ROW_HEIGHT)];
- titleLab.textColor = [UIColor blackColor];
- titleLab.font = [UIFont systemFontOfSize:15.0];
- titleLab.textAlignment = NSTextAlignmentCenter;
- titleLab.backgroundColor = [UIColor clearColor];
- [self.contentView addSubview:titleLab];
- self.actionLabel = titleLab ;
- [self.contentView setBackgroundColor:[UIColor colorWithWhite:0.9 alpha:0.5]];
- self.actionLabel = titleLab ;
- [self.actionLabel setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin];
-
- }
- - (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated // animate between regular and highlighted state
- {
-
- [super setHighlighted:highlighted animated:animated];
- if (highlighted) {
-
- [self.actionLabel setBackgroundColor:[UIColor colorWithWhite:0.9 alpha:0.5]];
- }else{
-
- [self.actionLabel setBackgroundColor:[UIColor whiteColor]];
- }
- }
- @end
|