React-native-blur: When setting a borderTopLeftRadius/TopRight/etc. radius - nothing happens

Created on 15 Mar 2017  路  9Comments  路  Source: Kureev/react-native-blur

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.

help wanted

Most helpful comment

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.
    },
});

All 9 comments

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

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.
    },
});

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.

So borderRadiusworks, 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).

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?

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

Anyone got this working?

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

seph14 picture seph14  路  3Comments

nc picture nc  路  6Comments

almirfilho picture almirfilho  路  3Comments

Doha26 picture Doha26  路  6Comments

renanmav picture renanmav  路  4Comments