NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

How to put multiple buttons in header while using search bar

Open gameboyVito opened this issue 9 years ago • 7 comments

Hi, I would like to put two buttons right beside the search bar in the header, but I cannot get it done. It always shows only one button on the right side of the search bar, do you have any solution offered to me? I am developing an IOS app.

react-native, react and native-base version: { "react-native": "0.40.0", "react": "15.4.2", "native-base": "0.5.18", }

Expected behaviour: image

Actual behaviour: image

Steps to reproduce:

<Header searchBar rounded>
                    <InputGroup>
                        <Icon name="ios-search"/>
                        <Input placeholder="Search project"/>
                    </InputGroup>
                    <Button
                        transparent
                        title='1'
                        onPress={() => null}>
                        <Icon name='ios-options'/>
                    </Button>
                    <Button                      
                        transparent
                        title='2'
                        onPress={() => null}>
                        <Icon name='ios-people'/>
                    </Button>
</Header>

Is the bug present in both ios and android or in any one of them? I only need to figure this out on IOS.

gameboyVito avatar Jan 30 '17 04:01 gameboyVito

Already fixed

gameboyVito avatar Jan 31 '17 08:01 gameboyVito

Hello Vito, how you do to fix it?

juanriglos avatar Jul 01 '17 16:07 juanriglos

Replacing the use of InputGroup with Item was what worked for me.

ongtzewei avatar Aug 21 '17 05:08 ongtzewei

How to solve this issue???

sseyha avatar Oct 04 '17 07:10 sseyha

@sseyha have you tried replacing all <InputGroup> tags with <Item>?

ongtzewei avatar Oct 04 '17 07:10 ongtzewei

@juanriglos Here is the example for you, if you would like. @ongtzewei I found the solution now. Thank so much.

===== ios ===== simulator screen shot - iphone 6 - 2017-10-04 at 16 34 35

===== Android ===== screenshot_1507109678

<View searchBar style={{flexDirection: 'row', padding:10}}>
        <Button transparent iconLeft style={{height:30}} onPress={() => null}>
          <Icon name="calendar"/>
        </Button>

        <InputGroup rounded style={{flex:1, backgroundColor:'#fff',height:30, paddingLeft:10, paddingRight:10}}>
          <Icon name="ios-search" />
          <Input style={{height:20}} placeholder="Search Article" />
          <Icon name="ios-list" />
        </InputGroup>

        <Button transparent style={{height:30}} onPress={() => null}>
          <Text>Search</Text>
        </Button>
      </View>



sseyha avatar Oct 04 '17 09:10 sseyha

@sseyha Can you help me? When i tried your code the searchbar looks fine. But when i write something in input i can't see the text. Only i tested in android errorseacrhbar

UPDATE: I solved it, only remove style "height:20" for input

Thanks!!!

edgargrs avatar May 31 '18 17:05 edgargrs