-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
Native Border Radius support #6
Comments
When setting |
Supported on iOS through 3f7d921, also enables Since I moved from the
|
On second thought, maybe it's not a good idea to try and support that natively. It's probably more efficient and less code to just let the containing view handle the clipping (border radius) |
Hi @mrousavy EDIT: My bad, on iOS I have a borderRadius params on the style props of the blurhash EDIT2: I can reproduce the issue with this simple code : <View style={{ width: 100, height: 100, borderRadius: 10, margin: 10 }}>
<Blurhash
blurhash="U56Td:M{00xvYjWCyEaKDgkX={M{Y8n$r;V?"
style={{ width: 100, height: 100, borderRadius: 10 }}
/>
</View> Output: EDIT 3: My bad, RTFM. <View
style={{
width: 100,
height: 100,
borderRadius: 10,
margin: 10,
overflow: 'hidden',
}}
>
<Blurhash
blurhash="U56Td:M{00xvYjWCyEaKDgkX={M{Y8n$r;V?"
style={{ width: 100, height: 100, borderRadius: 10 }}
/>
</View> Sorry for that, and thanks for this good work ! 👏 |
@gwenoleR yes, overflow hidden is the key here. I'm still not sure if I want to natively support border radius or just leave it up to the user to wrap it in an overflow hidden view 🤔 |
@andreialecu let me know if #119 fixes this for you. |
Currently, no border radius property is supported. You can achieve the same behaviour in react by setting
overflow: hidden
and then applying your borderRadius.To natively support borderRadius the property group has to be exposed and set on the native views (
UIImageView
,ReactImageView
).For Android the official image view provides this borderRadius prop, see the react native source code, not sure why that doesn't work in my case since
BlurhashImageView
is a derived class (fromReactImageView
)On iOS, this looks really easy, see this stackoverflow question. Couldn't find the react native's Image component source code, if anyone can help me out here I'd appreciate it.
The text was updated successfully, but these errors were encountered: