react-native-gesture-handler
react-native-gesture-handler copied to clipboard
Border does not appear in styling RectButton
@pcooney10 I'm facing the issue of border not appearing on Android. It does work well on iOS though. style props like borderRadius works, but borderWidth, borderColor does not work on Android
Originally posted by @yodaheis in https://github.com/kmagiera/react-native-gesture-handler/issues/225#issuecomment-467333032
I would like to bring to your attention border styling related issues on Android. Border doesn't appear on Android while it works well on iOS.
Environment: expo: 32.0.0
Also there is no ability to apply borderTopStartRadius
, borderTopEndRadius
, borderBottomStartRadius
, borderBottomEndRadius
properties to RectButton
I found that, for IOS, borderWidth works as expected but borderBottomWidth and borderTopWidth do not work. For Android, none of the three works.
Any update on this one?
Same here
Any update?
not working on Android
<RectButton />
is based on native RNGestureHandlerButton
component which does implement borderRadius
in a way that prevents using individual corners (here's more info about that).
It also doesn't support setting borderWidth
, nor borderWidth
.
iOS implementation subclasses standard RCTViewManager
class and supports every property that <View />
supports.
Hard to say if it will be fixed in the near future, but I'll keep it in my issues-that-should-be-fixed-sometime list 🙂
Code example showing this issue:
import React from 'react';
import { SafeAreaView, Text } from 'react-native';
import { RectButton } from 'react-native-gesture-handler';
const stylesToTest = {
borderRadius: 20, // works
borderWidth: 5, // doesn't work on android
borderColor: 'lightblue', // doesn't work on android
};
export default () => {
return (
<SafeAreaView style={styles.container}>
<RectButton style={[styles.rectangle, stylesToTest]}>
<Text>Press me!</Text>
</RectButton>
</SafeAreaView>
);
};
const styles = {
container: { flex: 1, justifyContent: 'center', alignItems: 'center' },
rectangle: {
backgroundColor: 'pink',
width: 100,
height: 100,
alignItems: 'center',
justifyContent: 'center',
},
};
same here
same here
try add the rect button inside a view.
same here
Any update? Having the same problem here!
This is because RectButton preserves the native shape of each platform. To solve this you can wrap your RectButton inside a View and style the View
I'm wondering if there is any update on this. @jakub-gonet
i do that way:
<RectButton
hitSlop={16}
style={{
borderRadius: 14,
backgroundColor: "white",
}}
>
<View
style={{
width: 28,
height: 28,
borderRadius: 14,
alignItems: "center",
justifyContent: "center",
borderWidth: 1,
borderColor: "#EAEAEA",
}}
>
<Text>+</Text>
</View>
</RectButton>