首页 > 解决方案 > 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>
      );

screenshot of the iOS app

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.

标签: javascriptreactjsreact-nativescrollviewtabnavigator

解决方案


这个问题不是由于导航器造成的,我们在滚动视图中遇到了同样的问题,最简单的排序方法是在滚动视图的底部使用填充。

<ScrollView  style={{ backgroundColor: '#DEFEFC',paddingBottom: 50}}>
</ScrollView>

根据项目的高度更新填充值。


推荐阅读