| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- //
- // TYTabTitleViewCell.m
- // TYPagerControllerDemo
- //
- // Created by tany on 16/5/4.
- // Copyright © 2016年 tanyang. All rights reserved.
- //
- #import "TYTabPagerBarCell.h"
- @interface TYTabPagerBarCell ()
- @property (nonatomic, weak) UILabel *titleLabel;
- @end
- @implementation TYTabPagerBarCell
- - (instancetype)initWithFrame:(CGRect)frame
- {
- if (self = [super initWithFrame:frame]) {
- [self addTabTitleLabel];
- }
- return self;
- }
- - (instancetype)initWithCoder:(NSCoder *)aDecoder
- {
- if (self = [super initWithCoder:aDecoder]) {
- [self addTabTitleLabel];
- }
- return self;
- }
- - (void)addTabTitleLabel
- {
- UILabel *titleLabel = [[UILabel alloc]init];
- titleLabel.font = [UIFont systemFontOfSize:13];
- titleLabel.textColor = [UIColor darkTextColor];
- titleLabel.textAlignment = NSTextAlignmentCenter;
- [self.contentView addSubview:titleLabel];
- _titleLabel = titleLabel;
- }
- + (NSString *)cellIdentifier {
- return @"TYTabPagerBarCell";
- }
- - (void)layoutSubviews
- {
- [super layoutSubviews];
- _titleLabel.frame = self.contentView.bounds;
- }
- @end
|