diff --git a/packages/components/src/layouts/TabView/StickyTabComponent/index.native.tsx b/packages/components/src/layouts/TabView/StickyTabComponent/index.native.tsx index a1850aa13f3..85fae764bf3 100644 --- a/packages/components/src/layouts/TabView/StickyTabComponent/index.native.tsx +++ b/packages/components/src/layouts/TabView/StickyTabComponent/index.native.tsx @@ -26,7 +26,7 @@ export const TabComponent = ( tabContentContainerStyle, style, onRefresh: onRefreshCallBack, - initialHeaderHeight = 250, + initialHeaderHeight = 0, }: ITabProps, // fix missing forwardRef warnings. // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -172,9 +172,18 @@ export const TabComponent = ( ); const onIndexChange = useCallback(() => {}, []); - const onLayout = useCallback(({ nativeEvent }: LayoutChangeEvent) => { - setHeaderHeight(nativeEvent.layout.height); - }, []); + const onLayout = useCallback( + ({ nativeEvent }: LayoutChangeEvent) => { + if (nativeEvent.layout.height === headerHeight) { + return; + } + if (platformEnv.isNativeAndroid && initialHeaderHeight > 0) { + return; + } + setHeaderHeight(nativeEvent.layout.height); + }, + [headerHeight, initialHeaderHeight], + ); return ( // @ts-expect-error diff --git a/packages/kit/src/views/Home/pages/HomePageView.tsx b/packages/kit/src/views/Home/pages/HomePageView.tsx index 1bbe211357e..ef0b2362617 100644 --- a/packages/kit/src/views/Home/pages/HomePageView.tsx +++ b/packages/kit/src/views/Home/pages/HomePageView.tsx @@ -140,6 +140,7 @@ export function HomePageView({ data={tabs} ListHeaderComponent={} initialScrollIndex={0} + initialHeaderHeight={220} contentItemWidth={CONTENT_ITEM_WIDTH} contentWidth={screenWidth} showsVerticalScrollIndicator={false} diff --git a/packages/kit/src/views/Market/MarketHome.tsx b/packages/kit/src/views/Market/MarketHome.tsx index b1f8fb986e9..18c643b0fca 100644 --- a/packages/kit/src/views/Market/MarketHome.tsx +++ b/packages/kit/src/views/Market/MarketHome.tsx @@ -153,7 +153,6 @@ function MarketHome() { return (