Want to real image is clickable but should not click the alpha background. Please suggest me how can i do this - react-native

i'm facing a problem in react native
Want to real image is clickable but should not click the alpha background. Please suggest me how can i do this.
In below image i used zIndex to placing the birds ,red color indicate the alpha area of above birdenter image description here

Unfortunately, there's no easy way to do this with React Native. The best solution I've found is by defining SVGs and using react-native-svg, which supports touch events. If you're using Expo, then it is already preinstalled and can be imported like import { Svg } from 'expo'; const { Circle, Rect } = Svg;.
Alternatively, you may be able to use a WebView (mirror) and CSS masking to achieve your desired result.

Related

React-native - Pulsating Image / SVG

Is it possible to pulsating a SVG in a Component? And how can i do this?
I found some packages but pulsating a circle, i want to pulsating a bag (SVG)
Yes, it's possible. react-native-svg allows you to import SVGs (with some setup), or you can use its primitives to convert an SVG to RN components. Then to animate it, use React Native's Animated API. The fade in/out example on the API page can be easily adapted to make a pulsing animation.

Using custom gif as a loading icon within <ActivityIndicator> using react-native

I am currently attempting to code an app in react native for an android device. I have created a custom loading component and am using the to show a loading icon.
But, I want to use a custom gif loading icon that contains my app's colours. I have looked but I cannot seem to find anything, is it possible to do this?
react native does not support gif feature in its raw form. However, in order to reach what you want and use gifs in the application, you can take a look at the accepted answer on the subject;
How do I display an animated gif in React Native?
Then all you need to do is to use Image component instead of ActivityIndicator. And passing the relevant gif information to the image component.

React Native BlurView Brightness too dark or too bright

I use a React Native BlurView in my React Native project. I want to have a blur effect like in Adobe XD or Figma where the color stays the same, but everything which is under the view will get blurred.
When I apply the BlurView on my View I get this result:
If I change it to dark it looks like this:
But is there no way that the colors stay the same like this?:
Sadly there is no option to do this. If you use React Native Blur View there is no option where you can choose whether the blur should be dark or bright. Today there is not good library for blur in React Native. Maybe there will be a new in the future.
Try to add a style to your BlurView and then add it a backGround color.
I would set the brightest one and then a light grey with transparency.

Using CSS dimensions in react-native

In normal css, dimensions like px, %, rem etc. works perfectly. But in react native, it throws an error.
Are there any possible ways to use these dimensions directly in react-native ?
REMs are a way of setting font-sizes based on the font-size of the root HTML element.
react native is purely works on pixels. Different mobile screens have different pixel ratio .
pixelRatio documentation in react native
if you want text normalization in react native
use my custom function in my open source project.
Suppose you want the width to be 50% of the View so you can do <View style={{width:'50%'}} /> .
Hope its clear. Feel free for doubts.

How to show progressive changing of image from one to another with loading indicator above the image in react-native

I need to show an image (eg:blur image) with loading indicator shows
the image is loading in UI. For eg) In facebook app feed posts are shows as loading before it fetch from server. I need the same.
Any suggestion or any package in react-native?
We have opacity prop and blurRadius prop for image in react native.
so what you can do is....
you can use async function to check if image is completely downloaded ...if yes then setState({downloaded:true}) and then if downloaded is true , based on your choice you can change the opacity to 100% for addon..you can even use activityindicator on top of that.
i hope it solves your problem...
you can also refer to this link : https://medium.com/the-react-native-log/progressive-image-loading-in-react-native-ecc88e724343