javascript - The last result from the search is hidden by the bottomTabNavigaor
问题描述
The problem is that the last result from the search is hidden by the bottomTabNavigaor and I can't scroll the last result above it.
I need to see the bottomTabNavigaor not to hide it.
return (
<View>
<ScrollView style={{ backgroundColor: '#DEFEFC'}}>
{musicList.map(songObj => {
return (
<View key={songObj.Song_ID} >
<TouchableOpacity style={styles.resultsContainer}
onPress={this.GetListViewItem.bind(this, songObj.Song_ID)}
>
<Text style={{ fontSize: 16, flex:1}} key={songObj.Song_ID}>
{songObj.Song_Name}
</Text>
<Image source={{ uri: songObj.Image }} style={styles.img} />
</TouchableOpacity>
</View>
);
})}
</ScrollView>
</View>
);
my bottomTabNavigator:
const HomeStack = createStackNavigator({
Home: HomeScreen
});
HomeStack.navigationOptions = {
tabBarLabel: "Home",
tabBarIcon: (
<Image
style={{ width: 27, height: 27 }}
source={{uri: bottomImage+ "/home.png"}}
/>
)
};
const SearchStack = createStackNavigator({
Search: SearchScreen
});
SearchStack.navigationOptions = {
tabBarLabel: "Search Music",
tabBarIcon: (
<Image
style={{ width: 27, height: 27 }}
source={{uri: bottomImage +"/search_1.jpg"}}
/>
)
};
/////----{ I shorten it you can guess the others} ---
export default createBottomTabNavigator({
HomeStack,
ArtistsStack,
SearchStack,
PlaylistStack,
ShowDataStack
});
if any additional code is needed please tell me and I'll put it here.
解决方案
这个问题不是由于导航器造成的,我们在滚动视图中遇到了同样的问题,最简单的排序方法是在滚动视图的底部使用填充。
<ScrollView style={{ backgroundColor: '#DEFEFC',paddingBottom: 50}}>
</ScrollView>
根据项目的高度更新填充值。
推荐阅读
- r - 使用 $ 运算符时循环返回 Null 值
- c# - AD B2C 防止新用户的密码过期
- sql-server - 在 Pyspark 结构化流中仅捕获 CDC 的有效负载?
- flutter - 从图库中挑选的颤振显示图像
- html - dzsparallaxer 组件需要时间来加载视差效果
- npm - 松露安装失败原因:getaddrinof EAI_AGAIN registry.npmjs.org registry.npmjs.org:443
- python - Django-gsheets 身份验证生成 JSOn 错误
- android - Surfaceflinger 和 HWC 上的辅助 DSI 显示
- ios - Apple Merchant Identity Cert 不接受 ECC 256 证书签名请求 (CSR)?
- visual-studio-code - 使用 zsh 从图标打开 VSCode 时如何加载环境变量?