android - Problem with ScrollView and SearchBar on Android / Expo-web
问题描述
I am making an website using react-native-web and i am having a problem with the mobile version of the app, especially with in android.
When i start scrolling the website, the searchBar and toolbar hide, and the app does not respond very well, leaving a white bar on the bottom, or ajusting in a strange way, videos below:
Before and after scrolling, when the bars hide
Here is my app.tsx file:
const App: React.FC = () => {
const { width, height } = useDimensions().window;
return (
<>
<Provider store={store}>
<Router>
<View
style={{
height: height < width ? height : Dimensions.get('window').height,
width: height < width ? width : Dimensions.get('window').width,
backgroundColor: '#0d0d0d',
}}
>
<StatusBar barStyle="light-content" backgroundColor="#0d0d0d" />
{height < width ? <WebRoutes /> : <MobileRoutes />}
</View>
</Router>
</Provider>
</>
);
};
and here my home page, with the ScrollView:
return (
<>
<LandingPage screenYAnimated={screenYAnimated} />
<Animated.ScrollView
ref={scrollViewRef}
scrollEventThrottle={16}
onScroll={Animated.event([
{ nativeEvent: { contentOffset: { y: screenYAnimated } } },
])}
style={{
flex: 1,
transform: [
{ scale: scaleScrollView },
{ translateY: translateScrollView },
],
}}
contentContainerStyle={{
flex: 1,
}}
>
<View
style={{
height: '100%',
width: '100%',
backgroundColor: 'transparent',
}}
/>
<ServiceSlide screenYAnimated={screenYAnimated} />
<Process screenYAnimated={screenYAnimated} />
<View style={{ height: 300, backgroundColor: 'transparent' }} />
<Works screenYAnimated={screenYAnimated} />
<Blog screenYAnimated={screenYAnimated} />
<Footer color="#595959" />
</Animated.ScrollView>
<Contact />
<Header animateHeader={animateHeader} />
</>
);
};
the transform part of the ScrollView is for an animation when i click the button, but they start at 1 and 0.
I wanted to know if is it possible for the searchbar and toolbar to remain static, or a way to fix the responsiveness of the app itself.
解决方案
推荐阅读
- laravel - 试图获取非对象的属性“product_id”
- python - Brython 中的 super().__str__() 是否应该返回不同的东西?
- google-analytics - 分析电子商务数据层事件未触发
- objective-c - dismissViewControllerAnimated 不调用父 viewWillAppear - 仅在 iPad 上
- postgis - 通过批处理脚本重启 postgres 服务
- python - 有什么方法可以找到两个语料库之间的相似性吗?
- appium - 无法在 iOS 的 Appium Inspector 中滑动
- java - 在 cplex 中输出一个二维变量数组
- blockchain - solidity 交易错误,如果您发送值并且您发送的值应该小于您当前的余额,则应该支付调用的函数
- mysql - 查找 min(date) 和 min(date)+value sql 之间的记录