-
-
Notifications
You must be signed in to change notification settings - Fork 980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Border does not appear in styling RectButton #477
Comments
Also there is no ability to apply |
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 |
It also doesn't support setting iOS implementation subclasses standard 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 |
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> |
## Description This PR is intended to allow the use of different border radius values on the RectButton component. As mentioned in comments on #477 , it doesn’t work on Android. I tried to follow the same implementation pattern from `borderRadius`, but using `setCornerRadii` method when informed at least one prop from specific corner. Also, it is possible to merge the values from `borderRadius` or from specific corner. <!-- Description and motivation for this PR. Include 'Fixes #<number>' if this is fixing some issue. --> ## Test plan <!-- Describe how did you test this change here. --> I added a component (RectButtonBorders) on example app with some variations of values to test the changes. --------- Co-authored-by: Jakub Piasecki <[email protected]>
## Description This PR enables the use of `borderWidth`, `borderColor` and `borderStyle` to style the `RectButton` component on Android. It's a continuation of #2792 Fixes #477 ## Test plan Some examples were added to the `RectButtonBorders` screen in the example app using the border styles changed in this PR.
@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 #225 (comment)
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
The text was updated successfully, but these errors were encountered: