React-native-picker-select: input text alignment

Created on 6 Feb 2019  路  3Comments  路  Source: lawnstarter/react-native-picker-select

I got an app for Android and IOS with React Native that requires the picker to align text to the right.

I tried with fontAlign, but errors that is not a valid property, I tried with textAlign, but warns that is not a valid property.

Most helpful comment

style.inputAndroid and/or style.inputIOS and textAlign: right works
android must be in useNativeAndroidPickerStyle={false}

not sure if you can modify text alignment on a native android picker element - you'll have to google that. if you can, you can apply props via pickerProps

All 3 comments

style.inputAndroid and/or style.inputIOS and textAlign: right works
android must be in useNativeAndroidPickerStyle={false}

not sure if you can modify text alignment on a native android picker element - you'll have to google that. if you can, you can apply props via pickerProps

thanks @lfkwtz that worked, but for some reason in Android a underline appeared, but setting the style for underline to opacity 0 or passing the pickerProps underlineColorAndroid = 'transparent' doesn't work, any clues?

Hey @lfkwtz I just figured out that the underline that appears if because the React Native default text input underline for android. Usually goes away with:

underlineColorAndroid={"transparent"}

as a property of textInput, I was trying to pass this through the textInputProps, but for some reason is cleared before reach the component. I ran a local copy of the component and adding the previously mentioned field makes the underline go away. Is there any chance to implement this on the component?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gregogalante picture gregogalante  路  4Comments

dquessenberry picture dquessenberry  路  7Comments

Fleuv picture Fleuv  路  8Comments

Friendly-Robot picture Friendly-Robot  路  5Comments

jenniferburch picture jenniferburch  路  4Comments