Skip to content

Blur Effect doesnt work on Android it gives full screen blur effect not parent component #89

@OFD16

Description

@OFD16

Describe the bug
In Android BlueEffect or others doesnt work it gives full screen background this blur effect but i want to give parent component.

To Reproduce

import { SubscriptionBgWeekly, SubscriptionBgMonthly } from "@src/assests";
import CustomText from "@src/components/custom-text";
import BlurCard from "./BlurCard";
import React, { useMemo, useRef, useState } from "react";
import {
    Animated,
    ImageBackground,
    Platform,
    StyleSheet,
    Text,
    TouchableOpacity,
    View,
} from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import { BlurSwitch, BlurView, LiquidGlassContainer, LiquidGlassView, ProgressiveBlurView } from '@sbaiahmed1/react-native-blur';

type TabKey = "weekly" | "monthly";

const SubscriptionTabs = () => {
    const [activeTab, setActiveTab] = useState<TabKey>("weekly");
    const insets = useSafeAreaInsets();

 
    return (
        <View style={styles.container}>
            <View style={[styles.tabBar, { top: insets.top + 200 }]}>
                <View style={{ flex: 1, position: 'relative', alignItems: 'center', justifyContent: 'center' }}>
                    <BlurView
                        blurType="light"
                        blurAmount={20}
                        style={{
                            position: 'absolute',
                            top: 100,
                            left: 50,
                            right: 50,
                            height: 200,
                            borderRadius: 20,
                        }}
                    >
                        <Text>Content with blur background</Text>
                    </BlurView>
                
                </View>
            </View>
        </View>
    );
};

const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: "#150D00",
    },

    tabBar: {
        position: "absolute",
        left: 16,
        right: 16,
        flexDirection: "row",
        gap: 12,
    },

});

export default SubscriptionTabs;

Expected behavior
Not same effect with IOS or it doest give parent component it gives full screen all components

Screenshots

Image

Also without Blur effect android screen shot is here:

Image

Smartphone (please complete the following information):

  • Device: sdk_gphone64_arm64
  • API 36

Additional context
package version: "@sbaiahmed1/react-native-blur": "^4.5.4",
react native version: 20.0.0

Metadata

Metadata

Assignees

Labels

androidAndroid onlybugSomething isn't workinghelp wantedExtra attention is needed

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions