facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.69k stars 24.29k forks source link

[Android] borderBottomWidth on TouchableOpacity don't work #8105

Closed sarovin closed 7 years ago

sarovin commented 8 years ago

Hi, i have a TouchableOpacity component with this style:

buttonStyle={{
   backgroundColor: 'white',
   borderBottomWidth: 4,
   borderColor: '#c6d0d5',
}}

The result is this: fbutton

Can't i set borderBottomWidht for android Platform?

flexzero commented 8 years ago

I think it's not possible directly for android. You have to override shape attribute for button style.

mkonicek commented 7 years ago

Hi there! This issue is being closed because it has been inactive for a while.

But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/android-borderbottomwidth-on-touchableopacity-dont-work

Product Pains has been very useful in highlighting the top bugs and feature requests: https://productpains.com/product/react-native?tab=top

Also, if this issue is a bug, please consider sending a pull request with a fix.

Pranit-Harekar commented 6 years ago

You can achieve this by setting borderStyle = "Solid" and then specify your desired borderBottomWidth. It works!!! 🎉

{
    borderStyle: "solid",
    borderBottomWidth: 1
}

also make sure you hide the default textinput underline in android by calling underlineColorAndroid="transparent" inside <TextInput /> tag