Skip to content

Commit f1e7dd1

Browse files
committed
调整过渡动画
1 parent 85ffa12 commit f1e7dd1

2 files changed

Lines changed: 19 additions & 6 deletions

File tree

Controller/MessageListViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ class MessageListViewController: BaseViewController<MessageListViewModel> {
9898

9999
if #available(iOS 26.0, *) {
100100
navigationItem.preferredSearchBarPlacement = .integratedButton
101+
self.tableView.contentInset = UIEdgeInsets(top: 20, left: 0, bottom: 0, right: 0)
101102
}
102103

103104
self.view.addSubview(tableView)
@@ -385,7 +386,6 @@ class MessageListViewController: BaseViewController<MessageListViewModel> {
385386
options: [.beginFromCurrentState, .curveEaseOut]
386387
) {
387388
self.initialLoadingView.alpha = 0
388-
self.initialLoadingView.transform = CGAffineTransform(scaleX: 0.992, y: 0.992)
389389
} completion: { _ in
390390
self.initialLoadingView.removeFromSuperview()
391391
}
@@ -414,7 +414,7 @@ class MessageListViewController: BaseViewController<MessageListViewModel> {
414414

415415
for cell in visibleCells {
416416
cell.alpha = 0
417-
cell.transform = CGAffineTransform(translationX: 0, y: 16)
417+
cell.transform = CGAffineTransform(translationX: 0, y: 10)
418418
}
419419

420420
return visibleCells

View/MessageList/MessageListSkeletonView.swift

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,26 @@ final class MessageListSkeletonView: UIView {
3333
static let dateBarCornerRadius: CGFloat = 3
3434
static let dateTopSpacing: CGFloat = 12
3535
static let cardSpacing: CGFloat = 10
36-
static let topInset: CGFloat = 10
36+
static let topInset: CGFloat = {
37+
if #available(iOS 26.0, *) {
38+
return 10 + 20
39+
}
40+
return 10
41+
}()
3742
static let bottomInset: CGFloat = 24
3843
}
3944

40-
private static let cardConfigs: [CardConfig] = [
45+
private static let baseCardConfigs: [CardConfig] = [
4146
CardConfig(titleWidthRatio: 0.55, lineWidthRatios: [0.90, 0.68, 0.40]),
4247
CardConfig(titleWidthRatio: 0.42, lineWidthRatios: [0.82, 0.52]),
4348
CardConfig(titleWidthRatio: 0.65, lineWidthRatios: [0.88, 0.72, 0.55]),
44-
CardConfig(titleWidthRatio: 0.48, lineWidthRatios: [0.78, 0.45])
49+
CardConfig(titleWidthRatio: 0.48, lineWidthRatios: [0.78, 0.45]),
50+
CardConfig(titleWidthRatio: 0.58, lineWidthRatios: [0.86, 0.62, 0.36])
51+
]
52+
53+
private static let padExtraCardConfigs: [CardConfig] = [
54+
CardConfig(titleWidthRatio: 0.50, lineWidthRatios: [0.80, 0.60]),
55+
CardConfig(titleWidthRatio: 0.62, lineWidthRatios: [0.92, 0.74, 0.48])
4556
]
4657

4758
private let stackView = UIStackView()
@@ -82,7 +93,9 @@ final class MessageListSkeletonView: UIView {
8293
}
8394

8495
private func buildCards() {
85-
for config in Self.cardConfigs {
96+
let cardConfigs = Self.baseCardConfigs + (traitCollection.userInterfaceIdiom == .pad ? Self.padExtraCardConfigs : [])
97+
98+
for config in cardConfigs {
8699
stackView.addArrangedSubview(MessageListSkeletonCardView(config: config, placeholderColor: placeholderColor))
87100
}
88101
}

0 commit comments

Comments
 (0)