From 96b9d45ec904e030610c3ab98bb436bb746ec328 Mon Sep 17 00:00:00 2001 From: Trae AI Date: Sat, 27 Dec 2025 10:47:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DiOS=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=A1=86=E9=9A=90=E8=97=8F=E6=97=B6=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E8=A2=AB=E5=BC=BA=E5=88=B6=E4=B8=8B=E6=8B=89=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.wxss | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/pages/index/index.wxss b/pages/index/index.wxss index 746af40..c3cd2af 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -25,24 +25,28 @@ page { padding: 10rpx 0; margin-bottom: 20rpx; overflow: hidden; - transition: max-height 0.4s ease-in-out, opacity 0.4s ease-in-out, transform 0.4s ease-in-out, margin-bottom 0.4s ease-in-out, padding 0.4s ease-in-out; - -webkit-transition: max-height 0.4s ease-in-out, opacity 0.4s ease-in-out, -webkit-transform 0.4s ease-in-out, margin-bottom 0.4s ease-in-out, padding 0.4s ease-in-out; - will-change: opacity, transform, max-height, margin; - max-height: 200rpx; + transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out; + -webkit-transition: opacity 0.4s ease-in-out, -webkit-transform 0.4s ease-in-out; + will-change: opacity, transform; opacity: 1; transform: translateY(0); -webkit-transform: translateY(0); + /* 使用固定高度,避免iOS系统重新计算布局 */ + height: 180rpx; } -/* 顶部搜索区域完全隐藏状态 - 用于平滑收缩高度 */ +/* 顶部搜索区域完全隐藏状态 - 使用transform隐藏,避免影响页面布局 */ .top-hidden { - max-height: 0; - padding: 0; - margin-bottom: 0; pointer-events: none; opacity: 0; - transform: translateY(-20rpx); - -webkit-transform: translateY(-20rpx); + /* 使用transform将搜索区域移出视口,而不是改变高度 */ + transform: translateY(-100%); + -webkit-transform: translateY(-100%); + /* 保留固定高度,避免页面布局变化 */ + height: 180rpx; + /* 保留padding和margin,避免页面布局变化 */ + padding: 10rpx 0; + margin-bottom: 20rpx; } /* 标题样式 */