react-native icon indicating copy to clipboard operation
react-native copied to clipboard

[Android] borderBottomWidth on TouchableOpacity don't work

Open sarovin opened this issue 10 years ago • 3 comments

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?

sarovin avatar Jun 14 '16 11:06 sarovin

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

flexzero avatar Jun 14 '16 12:06 flexzero

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.

mkonicek avatar Oct 27 '16 22:10 mkonicek

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

Pranit-Harekar avatar Nov 30 '17 15:11 Pranit-Harekar