React-native-google-places-autocomplete: Border is not able be styled

Created on 4 Aug 2017  路  3Comments  路  Source: FaridSafi/react-native-google-places-autocomplete

I have tried adjusting the border style on every possible component and I still can not get the top and bottom border to go away

screen shot 2017-08-03 at 3 51 54 pm

Here is my code for the component:

Has anyone experienced this issue? Any help would be greatly appreciated! Thanks

<GooglePlacesAutocomplete
             placeholder='Search'
             minLength={2} // minimum length of text to search
             autoFocus={false}
             returnKeyType={'search'} // Can be left out for default return key https://facebook.github.io/react-native/docs/textinput.html#returnkeytype
             listViewDisplayed='auto'    // true/false/undefined
             fetchDetails={true}
             renderDescription={(row) => row.description} // custom description render
             onPress={(data, details = null) => { // 'details' is provided when fetchDetails = true
               console.log('this is the data: ' + JSON.stringify(data));
               console.log('this is the Details: ' + JSON.stringify(details));
             }}
             getDefaultValue={() => {
               return ''; // text input default value
             }}
             query={{
               // available options: https://developers.google.com/places/web-service/autocomplete
               key: '',
               language: 'en', // language of the results
              //  types: '(cities)', // default: 'geocode'
             }}
             styles={{
               container: {
                 backgroundColor: 'transparent',
                 borderWidth: 0
               },
               description: {
                 fontWeight: 'bold',
                 borderWidth: 0
               },
               textInputContainer: {
                 backgroundColor: 'transparent',
                 borderColor: 'yellow',
                 borderWidth: 0
               },
               textInput: {
                 borderWidth: 0
               },
               loader: {
                 borderWidth: 0
               },
               listView: {
                 borderWidth: 0
               },
               predefinedPlacesDescription: {
                 borderWidth: 0
               },
               poweredContainer: {
                 borderWidth: 0
               },
               powered: {
                 borderWidth: 0
               },
               separator: {
                 borderWidth: 0
               }
              //  predefinedPlacesDescription: {
              //    color: '#1faadb',
              //  },
             }}

             currentLocation={false} // Will add a 'Current location' button at the top of the predefined places list
             currentLocationLabel="Current location"
             nearbyPlacesAPI='GooglePlacesSearch' // Which API to use: GoogleReverseGeocoding or GooglePlacesSearch
             GoogleReverseGeocodingQuery={{
               // available options for GoogleReverseGeocoding API : https://developers.google.com/maps/documentation/geocoding/intro
             }}
             GooglePlacesSearchQuery={{
               // available options for GooglePlacesSearch API : https://developers.google.com/places/web-service/search
               rankby: 'distance',
               types: 'food',
             }}


             filterReverseGeocodingByTypes={['locality', 'administrative_area_level_3']} // filter the reverse geocoding results by types - ['locality', 'administrative_area_level_3'] if you want to display only cities

             debounce={0} // debounce the requests in ms. Set to 0 to remove debounce. By default 0ms.
            //  renderLeftButton={() => <Text>source</Text>}
            //  renderRightButton={() => <Text>Custom text after the inputg</Text>}
          />

Most helpful comment

borderTopWidth/borderBottomWidth are what you want to target on the textInputContainer. adding to the readme!

All 3 comments

borderTopWidth/borderBottomWidth are what you want to target on the textInputContainer. adding to the readme!

How do i change the color of the border surrounding the textInput to transparent? I've tried putting backgroundColor as well as color as transparent, but it doesn't seem to effect the styling? A little help with this too please

textInputContainer: {
borderTopWidth: 0,
borderBottomWidth: 0,
backgroundColor: "#ffffff"
},

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DennisMuchiri picture DennisMuchiri  路  4Comments

aymkin picture aymkin  路  4Comments

quandevelopment picture quandevelopment  路  4Comments

macs03 picture macs03  路  3Comments

tgreco picture tgreco  路  3Comments