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

When setting a borderTopLeftRadius/TopRight/etc. radius - nothing happens

Open grundmanise opened this issue 8 years ago • 10 comments

Hi, first of all thank you for the component.

I can't set a topLeft & topRight radius on the BlurView. When I am setting borderTopLeftRadius/borderTopRightRadius/... on the BlurView - nothing happens. Setting it on the wrapper View - blur effect disappears.

grundmanise avatar Mar 15 '17 22:03 grundmanise

Hi @grundmanise, can you provide us some code so we can reproduce your issue?

Kureev avatar Mar 15 '17 22:03 Kureev

Yes, sure.

<BlurView style={styles.blurView} blurType="light" blurAmount={15} />

const styles = StyleSheet.create({
    blurView: {
        width: 200,
        height: 200,
        backgroundColor: 'rgba(0,0,0,.1)',
        borderTopLeftRadius: 100,
        borderTopRightRadius: 100,
        // borderRadius: 100, <- works
    },
});
<View style={styles.wrapper}>
   <BlurView style={styles.blurView} blurType="light" blurAmount={15} />
</View>

const styles = StyleSheet.create({
    blurView: {
        flex: 1,
        backgroundColor: 'rgba(0,0,0,.1)',
    },
   wrapper: {
        width: 200,
        height: 200,
        borderTopRightRadius: 100,
        borderTopLeftRadius: 100,
        overflow: 'hidden' //<- with overflow: 'visible' BlurView does not disappear, but borderRadius is not visible.
    },
});

grundmanise avatar Mar 15 '17 22:03 grundmanise

I think this can relate to https://github.com/react-native-community/react-native-blur/issues/154

grundmanise avatar Mar 15 '17 22:03 grundmanise

So borderRadius works, but if you use one of the border<Corner>Radius it breaks? If so, that sounds to me like a RN layout issue.

Side note: it's quite strange that rgba as a background color works for you. IIRC, UIBlurView can't have any opacity.

Kureev avatar Mar 16 '17 08:03 Kureev

So borderRadius works, but if you use one of the border<Corner>Radius it breaks

Exactly.

Can _visualEffectView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; , dispatch_async and not subclassing RCTView cause this issue?

Should have mentioned: I only tried on iOS (device).

grundmanise avatar Mar 16 '17 09:03 grundmanise

Hiya folks, I'm having the same issue (iPhone 6|ios 10.2.1|RN 0.40.0) Would like to try + fix but I'm not particularly experienced with iOS. Any pointers that might help my investigation?

robsquires avatar Apr 11 '17 11:04 robsquires

Same issue.
@grundmanise Great thanks for the wrapper! Cool, man!

radetsky avatar Apr 04 '18 17:04 radetsky

Anyone got this working?

ejkkan avatar Mar 06 '19 19:03 ejkkan

Yes, it's working. Read https://github.com/react-native-community/react-native-blur/issues/161#issuecomment-286898330 and you will see that with a wrapper with overflow property it just works.

radetsky avatar Mar 07 '19 17:03 radetsky

Hey guys. In my case, borderRadius has no effect. Im on android : image

Code:

`<BlurView style={{ borderRadius:20}} overlayColor={'transparent'} blurType="light" blurAmount={10}

`

Also a small sidenote: see that space between the blur and the white view inside it at the bottom? No padding or margin. And it ONLY disappears when I give the blurview borderWidth: 2 ... aint that some weird stuff

C-odes avatar Jul 24 '21 10:07 C-odes