fix: 固定首页常用应用图标尺寸
This commit is contained in:
@ -127,6 +127,13 @@ final class HomeMenuCell: UICollectionViewCell {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
override func prepareForReuse() {
|
||||
super.prepareForReuse()
|
||||
iconView.image = nil
|
||||
iconView.accessibilityIdentifier = nil
|
||||
titleLabel.text = nil
|
||||
}
|
||||
|
||||
func apply(menu: HomeMenuItem) {
|
||||
iconView.image = HomeMenuIconFactory.image(named: menu.iconName)
|
||||
iconView.accessibilityIdentifier = menu.iconName
|
||||
@ -146,9 +153,8 @@ final class HomeMenuCell: UICollectionViewCell {
|
||||
iconContainerView.layer.cornerRadius = 20
|
||||
|
||||
iconView.tintColor = AppColor.primary
|
||||
iconView.contentMode = .scaleAspectFit
|
||||
iconView.preferredSymbolConfiguration = HomeMenuIconFactory.symbolConfiguration
|
||||
|
||||
iconView.contentMode = .center
|
||||
iconView.adjustsImageSizeForAccessibilityContentSizeCategory = false
|
||||
|
||||
contentStackView.axis = .vertical
|
||||
contentStackView.alignment = .center
|
||||
@ -176,6 +182,8 @@ final class HomeMenuCell: UICollectionViewCell {
|
||||
iconContainerView.snp.makeConstraints { make in
|
||||
make.width.height.equalTo(40)
|
||||
}
|
||||
iconContainerView.setContentHuggingPriority(.required, for: .vertical)
|
||||
iconContainerView.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||
iconView.snp.makeConstraints { make in
|
||||
make.center.equalToSuperview()
|
||||
make.width.height.equalTo(24)
|
||||
|
||||
Reference in New Issue
Block a user