Questions tagged [imagebackground]

78 questions
41
votes
15 answers

How to use ImageBackground to set background image for screen in react-native

When I use in react-native it gives warning that using with children is deprecated and will be error in future. User instead. So, If I use it doesn't give expected result which I was getting using Here is the code I wrote for using…
Waqas
  • 959
  • 1
  • 8
  • 17
28
votes
4 answers

React-Native: Change opacity colour of ImageBackground

I have been trying to develop screen mentioned below: For that I have created below component: import React, {Component} from 'react'; import {View, Text, StyleSheet, ImageBackground, Image} from 'react-native'; import Balance from…
AndiGeeky
  • 11,266
  • 6
  • 50
  • 66
8
votes
3 answers

React Native ImageBackground Orientation Change

Even though I can get a screen orientation change to update state and re-render, the ImageBackground component still will not update its width. I have the following code: this.mylayoutchange(event)} style={{ flex: 1,…
kojow7
  • 10,308
  • 17
  • 80
  • 135
6
votes
3 answers

LinearGradient above ImageBackground in react-native expo

In my react-native expo app, i have a background image that is taking full height and width in all screens and i want to put a lineargradient above the background image but it's not working, the image is always appearing above the gradient, here is…
5
votes
1 answer

ImageBackground repeat on Android not filling up the screen

I am building an app using react native and I want to achieve a background image with repeat resize mode like this.
5
votes
1 answer

TypeError: Cannot read property 'width' of undefined when using ImageBackground

I am using the ImageBackground component from React Native. However, no matter what style I choose the same error message always displays. The code looks as it follows: render() { return (
marcos-cr
  • 53
  • 1
  • 5
5
votes
0 answers

React Native background image - cover and vertical align to top

I am looking for a way to add a background image in React Native that would be styled equivalent to HTML's: background-size: cover; background-position: top center; I am using ImageBackground and resizeMode="cover" but the image is vertically…
eggnukes
  • 180
  • 3
  • 20
3
votes
1 answer

React-Native : Can react native find out the exact absolute position for each device?

I want to show text on image using absolute position. However, it is difficult to determine the exact position because the screen size is different for each device. Is there a way to calculate the exact position? I posted a similar question, but I…
ezkoon
  • 45
  • 5
3
votes
0 answers

React Native: Get current height and width of Image in 'ImageBackground' after resize mode ''contain" is applied

I am selecting an image from gallery and loading it into ImageBackground(which have fixed height and width) in react native and resizeMode "Contain" is applied on that, I would like to able to know the current height and width of the image when…
3
votes
2 answers

How to add a static background image for screens in Material Top Tab Navigator?

I have created two tabs with createMaterialTopTabNavigator from react-navigation. I like to have a single background image for two tabs. The current behaviour is that when I swipe from tab1 to tab2, the image is also transitioned, but I like to…
3
votes
2 answers

ReactNative - ImageBackground load local image with a delay

I noticed that, when I run the react-native app, the images that I set as background using the tag load with a delay of almost 2 seconds, even if they are not heavy images (~100K) and they are stored in local. I have also read this…
th3g3ntl3man
  • 1,926
  • 5
  • 29
  • 50
3
votes
1 answer

React Native BackgroundImage doesn't show required GIFs - iOS

is it possible, to show animated GIFs with - source={require(...)} on iOS with React-Native? The following example do not work: This Example works:
iSaBo
  • 157
  • 1
  • 2
  • 16
2
votes
0 answers

Object-position on an ImageBackground in react-native

I'm trying to change how my ImageBackground is show inside my container. The height of the image is bigger than the one of my container, so I would like to show the top of the image, not the center. Like in CSS with OBject-position
2
votes
1 answer

How to remove image background programmatically in flutter?

I need to remove the image background to white when I pick an image from the image picker, but I don't want to use API for that work. I can use a third-party plugin.
2
votes
0 answers

React Native AWS Amplify Background Image

Hey guys I am trying to make an app using AWS Amplify and React Native. I want to just add a background image to my app and for that small purpose, I don't want to create an entirely custom component to display for the Sign In Screen. Here is my…
addd
  • 77
  • 1
  • 6
1
2 3 4 5 6