umhan35 / react-native-search-bar

The high-quality iOS native search bar for react native.
MIT License
867 stars 209 forks source link

[android] Left margin #161

Closed oxyii closed 5 years ago

oxyii commented 5 years ago

I'm not sure that this is correct way to fix left margin but it's works!

Related SO

P.S. Thanks for the great component! I hope you continue to develop it! Especially in the part of Android-platform

oxyii commented 5 years ago

@iRoachie Wow! You are here too ))) Hi !!! About this PR:

BEFORE WhatsApp Image 2019-10-20 at 00 46 09

AFTER WhatsApp Image 2019-10-20 at 00 35 46

iRoachie commented 5 years ago

Haha Yea, I manage a few libs. Thanks for the contribution 🎉

iRoachie commented 5 years ago

Live in v3.5.1

oxyii commented 5 years ago

@iRoachie Great! Thanks!

P.S. About RNN headers. I don't know why but on iOS platform search-bar with searchBarStyle="minimal" placed correct only with margin wrapper. I'm not sure that this is bug... Just for information

<View style={{ marginTop: -8 }}>
  <SearchBar searchBarStyle="minimal" />
</View>
iRoachie commented 5 years ago

Seems to work fine for me

image

<SafeAreaView style={styles.container}>
  <SearchBar searchBarStyle="minimal" />
</SafeAreaView>

...

const styles = StyleSheet.create({
  container: {
    backgroundColor: Colors.lighter,
    justifyContent: 'center',
  },
});
oxyii commented 5 years ago

@iRoachie I mean RNN iOS native header (in stack). But it can be issue of title position in RNN iOS header. I'm not sure.

Navigation.registerComponent('searchbar', () => SearchBar);
Navigation.setRoot({
  root: {
    stack: {
      children: [
        {
          component: {
            name: 'screen.component',
            options: {
               topBar: {
                 title: {
                   component: {
                      name: 'searchbar',
                      alignment: 'fill',
                   },
                 },
               },
            },
          }
        }
      ],
    },
  }
});
iRoachie commented 5 years ago

Oh I don't know anything about react-native-navigation. I haven't used it in few years. I only use react-navigation

oxyii commented 5 years ago

@iRoachie Okay. If <SearchBar searchBarStyle="minimal" /> did not have any vertical paddings on iOS then it's exactly RNN issue.

Just for information

Thank you!

oxyii commented 5 years ago

@iRoachie About RNN iOS header - confirmed. This is a RNN issue