[iOS] SearchBar and TabBar on same screen #616
-
I s it possible to have a SearchBar in a top NavigationBar and a TabBar in a bottom NavigationBar at the same time without the SearchBar being double height as detailed here? I've tried adding a hidden NavigationBar, as suggested, but the issue persists. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I added a search bar to the twitter sample and there's no double height in the video below. Maybe you mean the gap at the top when it's expaned? If you don't want that you shouldn't set Screen.Recording.2022-07-17.at.19.24.56.movThis is the code you can paste into Home component if you want to test it out import React, {useState} from 'react';
import {Platform, ScrollView} from 'react-native';
import {NavigationBar, CoordinatorLayout, SearchBar} from 'navigation-react-native';
import Tweets from './Tweets';
import {getHome} from './data';
export default ({tweets}) => {
const [text, setText] = useState('');
return (
<ScrollView contentInsetAdjustmentBehavior="automatic">
<NavigationBar largeTitle={true} title="Home" barTintColor={Platform.OS === 'android' ? '#fff' : 'rgb(247,247,247)'}>
<SearchBar
text={text}
autoCapitalize="none"
obscureBackground={false}
onChangeText={text => setText(text)}>
<ScrollView></ScrollView>
</SearchBar>
</NavigationBar>
<Tweets tweets={getHome()} />
</ScrollView>
)
}; |
Beta Was this translation helpful? Give feedback.
I added a search bar to the twitter sample and there's no double height in the video below. Maybe you mean the gap at the top when it's expaned? If you don't want that you shouldn't set
largeTitle
to true on theNavigationBar
Screen.Recording.2022-07-17.at.19.24.56.mov
This is the code you can paste into Home component if you want to test it out