@@ -15,8 +15,8 @@ final class IssueManagingActionCell: UICollectionViewCell, ListBindable {
15
15
private let label = UILabel ( )
16
16
private let imageView = UIImageView ( )
17
17
18
- static let iconHeight = Styles . Sizes. buttonIcon. height + Styles. Sizes. rowSpacing * 3
19
- static let height = ceil ( iconHeight + Styles. Sizes. rowSpacing * 2.5 + Styles. Text. secondary. size )
18
+ static let iconHeight = Styles . Sizes. buttonIcon. height + Styles. Sizes. rowSpacing * 2
19
+ static let height = ceil ( iconHeight + Styles. Sizes. rowSpacing * 2.5 + Styles. Text. secondary. preferredFont . lineHeight )
20
20
21
21
override init ( frame: CGRect ) {
22
22
super. init ( frame: frame)
@@ -28,35 +28,28 @@ final class IssueManagingActionCell: UICollectionViewCell, ListBindable {
28
28
contentView. layer. cornerRadius = Styles . Sizes. cardCornerRadius
29
29
30
30
let iconSize = IssueManagingActionCell . iconHeight
31
- imageView. contentMode = . center
31
+ imageView. contentMode = . bottom
32
32
imageView. clipsToBounds = true
33
33
contentView. addSubview ( imageView)
34
34
imageView. snp. makeConstraints { make in
35
35
make. size. equalTo ( CGSize ( width: iconSize, height: iconSize) )
36
- make. centerX. equalTo ( contentView )
37
- make. top . equalTo ( contentView ) . offset ( Styles . Sizes . rowSpacing / 2 )
36
+ make. centerX. equalToSuperview ( )
37
+ make. centerY . equalToSuperview ( ) . offset ( - iconSize / 2 )
38
38
}
39
39
40
40
label. textColor = tint
41
41
label. font = Styles . Text. secondaryBold. preferredFont
42
42
contentView. addSubview ( label)
43
43
label. snp. makeConstraints { make in
44
44
make. centerX. equalTo ( imageView)
45
- make. top. equalTo ( imageView. snp. bottom) . offset ( - Styles. Sizes. rowSpacing)
45
+ make. top. equalTo ( imageView. snp. bottom) . offset ( Styles . Sizes. rowSpacing/ 2 + 2 )
46
46
}
47
47
}
48
48
49
49
required init ? ( coder aDecoder: NSCoder ) {
50
50
fatalError ( " init(coder:) has not been implemented " )
51
51
}
52
52
53
- override func layoutSubviews( ) {
54
- super. layoutSubviews ( )
55
- let height = bounds. height - Styles. Sizes. rowSpacing
56
- contentView. frame = CGRect ( x: 0 , y: 0 , width: height, height: height)
57
- contentView. center = CGPoint ( x: bounds. width/ 2 , y: bounds. height/ 2 )
58
- }
59
-
60
53
override var isSelected : Bool {
61
54
didSet {
62
55
highlight ( isSelected)
0 commit comments