fix: 优化图片预览索引胶囊
This commit is contained in:
@@ -41,6 +41,7 @@ final class TravelAlbumPhotoPreviewViewController: UIViewController {
|
||||
private let closeButton = UIButton(type: .system)
|
||||
private let titleLabel = UILabel()
|
||||
private let sizeLabel = UILabel()
|
||||
private let counterContainer = UIView()
|
||||
private let counterLabel = UILabel()
|
||||
private let bottomChrome = UIView()
|
||||
private let divider = UIView()
|
||||
@@ -159,10 +160,13 @@ final class TravelAlbumPhotoPreviewViewController: UIViewController {
|
||||
counterLabel.textColor = UIColor.white.withAlphaComponent(0.82)
|
||||
counterLabel.font = .monospacedDigitSystemFont(ofSize: 15, weight: .medium)
|
||||
counterLabel.textAlignment = .center
|
||||
counterLabel.backgroundColor = UIColor(white: 0.11, alpha: 1)
|
||||
counterLabel.layer.cornerRadius = 17
|
||||
counterLabel.clipsToBounds = true
|
||||
counterLabel.numberOfLines = 1
|
||||
counterLabel.accessibilityIdentifier = "travelAlbum.previewCounterLabel"
|
||||
counterLabel.setContentHuggingPriority(.required, for: .horizontal)
|
||||
counterLabel.setContentCompressionResistancePriority(.required, for: .horizontal)
|
||||
counterContainer.backgroundColor = UIColor(white: 0.11, alpha: 1)
|
||||
counterContainer.layer.cornerRadius = 17
|
||||
counterContainer.clipsToBounds = true
|
||||
|
||||
variantSegmentedControl.selectedSegmentTintColor = UIColor(white: 0.22, alpha: 1)
|
||||
variantSegmentedControl.backgroundColor = UIColor(white: 0.065, alpha: 1)
|
||||
@@ -200,7 +204,8 @@ final class TravelAlbumPhotoPreviewViewController: UIViewController {
|
||||
view.addSubview(topChrome)
|
||||
topChrome.addSubview(closeButton)
|
||||
topChrome.addSubview(titleStack)
|
||||
topChrome.addSubview(counterLabel)
|
||||
topChrome.addSubview(counterContainer)
|
||||
counterContainer.addSubview(counterLabel)
|
||||
view.addSubview(bottomChrome)
|
||||
bottomChrome.addSubview(divider)
|
||||
bottomChrome.addSubview(variantControls)
|
||||
@@ -217,16 +222,20 @@ final class TravelAlbumPhotoPreviewViewController: UIViewController {
|
||||
make.bottom.equalToSuperview().offset(-14)
|
||||
make.size.equalTo(44)
|
||||
}
|
||||
counterLabel.snp.makeConstraints { make in
|
||||
counterContainer.snp.makeConstraints { make in
|
||||
make.trailing.equalToSuperview().inset(16)
|
||||
make.centerY.equalTo(closeButton)
|
||||
make.width.greaterThanOrEqualTo(48)
|
||||
make.height.equalTo(34)
|
||||
}
|
||||
counterLabel.snp.makeConstraints { make in
|
||||
make.leading.trailing.equalToSuperview().inset(12)
|
||||
make.centerY.equalToSuperview()
|
||||
}
|
||||
titleStack.snp.makeConstraints { make in
|
||||
make.centerY.equalTo(closeButton)
|
||||
make.leading.greaterThanOrEqualTo(closeButton.snp.trailing).offset(8)
|
||||
make.trailing.lessThanOrEqualTo(counterLabel.snp.leading).offset(-8)
|
||||
make.trailing.lessThanOrEqualTo(counterContainer.snp.leading).offset(-8)
|
||||
make.centerX.equalToSuperview()
|
||||
make.width.lessThanOrEqualTo(220)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user