123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- //
- // TopicBookCell.m
- // smartRhino
- //
- // Created by niuzhen on 2020/7/21.
- // Copyright © 2020 tederen. All rights reserved.
- //
- #import "TopicBookCell.h"
- @implementation TopicBookCell
- - (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
- }
- + (TopicBookCell *)configCell0:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
- static NSString *cellIdentifer = @"TopicBookCell0";
- TopicBookCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
- if (cell == nil || !cell) {
- cell = [[[NSBundle mainBundle] loadNibNamed:@"TopicBookCell" owner:nil options:nil] objectAtIndex:0];
- }
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- return cell;
- }
- + (TopicBookCell *)configCell1:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
- static NSString *cellIdentifer = @"TopicBookCell1";
- TopicBookCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
- if (cell == nil || !cell) {
- cell = [[[NSBundle mainBundle] loadNibNamed:@"TopicBookCell" owner:nil options:nil] objectAtIndex:1];
- }
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- return cell;
- }
- + (TopicBookCell *)configCell2:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
- static NSString *cellIdentifer = @"TopicBookCell2";
- TopicBookCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
- if (cell == nil || !cell) {
- cell = [[[NSBundle mainBundle] loadNibNamed:@"TopicBookCell" owner:nil options:nil] objectAtIndex:2];
- }
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- return cell;
- }
- - (void)layoutSubviews
- {
- [super layoutSubviews];
- CGRect rect = self.contentView.frame;
- rect.size.width += rect.origin.x;
- rect.origin.x = 0;
- self.contentView.frame = rect;
- for (UIView *supView in self.subviews){
- if ([supView isKindOfClass:NSClassFromString(@"UITableViewCellReorderControl")]){
- for (UIView *view in supView.subviews)
- {
- if ([view isKindOfClass: [UIImageView class]])
- {
- view.hidden = NO;
- UIImageView * imagV = (UIImageView *)view;
- [imagV setFrame:CGRectMake(0, 0, 22, 18)];
- imagV.center = supView.center;
- imagV.contentMode = UIViewContentModeCenter;
- imagV.image = [UIImage imageNamed: @"list_sort"];
- UIView * label = [UIView new];
- label.backgroundColor = UIColorHex(0xEEEEEE);
- [supView addSubview:label];
- [label setFrame:CGRectMake(0, supView.frame.size.height - 0.5, supView.frame.size.width, 0.5)];
- }else{
- view.hidden = YES;
- }
- }
- }
- if ([supView isKindOfClass:NSClassFromString(@"UITableViewCellEditControl")]){
- [supView removeFromSuperview];
- }
- }
- }
- @end
|