feat: 更新视图组件以优化用户交互体验

- 在CreateFeedView中添加视图消失时重置键盘状态的逻辑,提升用户体验。
- 在DetailView中调整顶部内边距,改善布局效果。
- 在FeedListView中新增刷新功能的回调,增强动态加载体验。
- 在MainView中为底部导航栏留出空间并固定在底部,优化界面布局。
This commit is contained in:
edwinQQQ
2025-07-28 16:38:26 +08:00
parent d35071d3de
commit 488c6fc7ab
4 changed files with 16 additions and 3 deletions

View File

@@ -163,6 +163,10 @@ struct CreateFeedView: View {
.onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardWillHideNotification)) { _ in
keyboardHeight = 0
}
.onDisappear {
//
keyboardHeight = 0
}
}
}

View File

@@ -35,7 +35,7 @@ struct DetailView: View {
}
)
}
.padding(.top, 44)
.padding(.top, 24)
//
ScrollView {
@@ -57,6 +57,7 @@ struct DetailView: View {
)
.padding(.horizontal, 16)
.padding(.top, 16)
.padding(.bottom, 116)
}
}
}

View File

@@ -123,6 +123,7 @@ struct MomentsListView: View {
let onMomentTap: (MomentsInfo) -> Void
let onLikeTap: (Int, Int, Int, Int) -> Void
let onLoadMore: () -> Void
let onRefresh: () -> Void
let likeLoadingDynamicIds: Set<Int>
var body: some View {
@@ -161,7 +162,7 @@ struct MomentsListView: View {
.padding(.bottom, 20)
}
.refreshable {
onLoadMore()
onRefresh()
}
}
}
@@ -196,6 +197,9 @@ struct FeedListContentView: View {
onLoadMore: {
viewStore.send(.loadMore)
},
onRefresh: {
viewStore.send(.reload)
},
likeLoadingDynamicIds: viewStore.likeLoadingDynamicIds
)
}

View File

@@ -90,7 +90,9 @@ struct InternalMainView: View {
selectedTab: viewStore.selectedTab
)
.frame(maxWidth: .infinity, maxHeight: .infinity)
//
.padding(.bottom, 80) //
// -
VStack {
Spacer()
BottomTabView(selectedTab: viewStore.binding(
@@ -98,6 +100,8 @@ struct InternalMainView: View {
send: { MainFeature.Action.selectTab(MainFeature.Tab(rawValue: $0.rawValue) ?? .feed) }
))
}
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .bottom)
.ignoresSafeArea(.keyboard, edges: .bottom)
// API Loading
APILoadingEffectView()