@@ -30,6 +30,9 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
30
30
// self.textLabel.backgroundColor = self.backgroundColor;
31
31
// self.detailTextLabel.backgroundColor = self.backgroundColor;
32
32
33
+ self.titleLabel .backgroundColor = self.backgroundColor ;
34
+ self.infoLabel .backgroundColor = self.backgroundColor ;
35
+
33
36
self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
34
37
35
38
// Border width of 1 pixel:
@@ -97,39 +100,53 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
97
100
98
101
99
102
// TextLabel
100
- self.textLabel .font = [UIFont fontWithName: @" Helvetica" size: 17.0 ];
101
- self.textLabel .numberOfLines = 1 ;
102
- self.textLabel .translatesAutoresizingMaskIntoConstraints = NO ;
103
+ // self.textLabel.font = [UIFont fontWithName:@"Helvetica" size:17.0];
104
+ // self.textLabel.numberOfLines = 1;
105
+ // self.textLabel.translatesAutoresizingMaskIntoConstraints = NO;
106
+
107
+ self.titleLabel = [UILabel new ];
108
+ self.titleLabel .font = [UIFont fontWithName: @" HelveticaNeue" size: 17.0 ];
109
+ self.titleLabel .numberOfLines = 1 ;
110
+ self.titleLabel .translatesAutoresizingMaskIntoConstraints = NO ;
111
+ self.titleLabel .adjustsFontSizeToFitWidth = YES ;
112
+ [self .contentView addSubview: self .titleLabel];
113
+
114
+ // self.detailTextLabel.font = [UIFont fontWithName:@"Helvetica" size:14.0];
115
+ // self.detailTextLabel.numberOfLines = 1;
116
+ // self.detailTextLabel.translatesAutoresizingMaskIntoConstraints = NO;
103
117
104
- self.detailTextLabel .font = [UIFont fontWithName: @" Helvetica" size: 14.0 ];
105
- self.detailTextLabel .numberOfLines = 1 ;
106
- self.detailTextLabel .translatesAutoresizingMaskIntoConstraints = NO ;
118
+ self.infoLabel = [UILabel new ];
119
+ self.infoLabel .font = [UIFont fontWithName: @" HelveticaNeue" size: 14.0 ];
120
+ self.infoLabel .numberOfLines = 1 ;
121
+ self.infoLabel .translatesAutoresizingMaskIntoConstraints = NO ;
122
+ self.infoLabel .adjustsFontSizeToFitWidth = YES ;
123
+ [self .contentView addSubview: self .infoLabel];
107
124
108
125
// Set next text labels contraints :
109
- [self .contentView addConstraints: [NSLayoutConstraint constraintsWithVisualFormat: @" H:[imageView1]-(offset)-[textLabel ]-|"
126
+ [self .contentView addConstraints: [NSLayoutConstraint constraintsWithVisualFormat: @" H:[imageView1]-(offset)-[titleLabel ]-|"
110
127
options: 0
111
128
metrics: @{@" offset" : @(kAlbumImageToTextSpace )}
112
- views: @{@" textLabel " : self.textLabel ,
129
+ views: @{@" titleLabel " : self.titleLabel ,
113
130
@" imageView1" : self.imageView1 }]];
114
131
115
- [self .contentView addConstraints: [NSLayoutConstraint constraintsWithVisualFormat: @" H:[imageView1]-(offset)-[detailTextLabel ]-|"
132
+ [self .contentView addConstraints: [NSLayoutConstraint constraintsWithVisualFormat: @" H:[imageView1]-(offset)-[infoLabel ]-|"
116
133
options: 0
117
134
metrics: @{@" offset" : @(kAlbumImageToTextSpace )}
118
- views: @{@" detailTextLabel " : self.detailTextLabel ,
135
+ views: @{@" infoLabel " : self.infoLabel ,
119
136
@" imageView1" : self.imageView1 }]];
120
137
121
138
122
- [self .contentView addConstraints: @[[NSLayoutConstraint constraintWithItem: self .textLabel
139
+ [self .contentView addConstraints: @[[NSLayoutConstraint constraintWithItem: self .titleLabel
123
140
attribute: NSLayoutAttributeBottom
124
141
relatedBy: NSLayoutRelationEqual
125
- toItem: self .textLabel .superview
142
+ toItem: self .titleLabel .superview
126
143
attribute: NSLayoutAttributeCenterY
127
144
multiplier: 1 .f constant: 0 .f]]];
128
145
129
- [self .contentView addConstraints: @[[NSLayoutConstraint constraintWithItem: self .detailTextLabel
146
+ [self .contentView addConstraints: @[[NSLayoutConstraint constraintWithItem: self .infoLabel
130
147
attribute: NSLayoutAttributeTop
131
148
relatedBy: NSLayoutRelationEqual
132
- toItem: self .textLabel .superview
149
+ toItem: self .titleLabel .superview
133
150
attribute: NSLayoutAttributeCenterY
134
151
multiplier: 1 .f constant: +4 .f]]];
135
152
}
0 commit comments