alwx / react-native-photo-view

Pinch-to-zoom view for React Native (both iOS and Android)
MIT License
816 stars 435 forks source link

Change background color #94

Closed MunazR closed 6 years ago

MunazR commented 6 years ago

Is there a way to change the background color of the photo view for iOS? Currently it is black.

diegotsi commented 6 years ago

I need to know too. Actually, I'd like to put one loading indicator.How Can i do this?

MunazR commented 6 years ago

I created a fork of the repo with the background color set to white if anybody is interested

https://github.com/MunazR/react-native-photo-view

GibranPolonsky commented 6 years ago

I think this is a great point, we still need this.

alwx commented 6 years ago

Fixed in https://github.com/alwx/react-native-photo-view/commit/848bcdf869fe1c4b06bda502be20f67f4e464eac

MunazR commented 6 years ago

Thank you!

douglasjunior commented 6 years ago

Why was the color changed to white? Most other apps use black. Like Facebook and Whatsapp.

edwardgalligan commented 6 years ago

Fixed

This seems an odd fix. I think the original issue was requesting a configurable background colour, not a global change to a different unconfigurable one.

I came here looking for a way to change it away from black myself, but I do think black is a good default value.

edwardgalligan commented 6 years ago

For anyone finding this issue:

I've patched my own copy of react-native-photo-view by changing the colour in RNPhotoView.m to [UIColor clearColor] - this works best as it allows you to then set any colour on the background of the parent.

maciekstosio commented 6 years ago

How is it now? Because I've got black background, but actually I prefer white one...

drpiou commented 6 years ago

Still cannot change background color for iOS, Android is working fine...

ben-snaize commented 6 years ago

+1 - we need a fix for this.

SimonErich commented 6 years ago

+1

lucidtheory commented 6 years ago

It does work

You need to uninstall the app from your simulator and also in package.json install directly from the github repo

  "dependencies": {
    .....other dependencies
    "react-native-photo-view": "github:alwx/react-native-photo-view",
  },

then reinstall the app on your simulator react-native run-ios (or android)

good to go

MaheshNandam commented 6 years ago

Solved By changing at RNPhotoView.m:

backgroundColor = [UIColor black] to backgroundColor = [UIColor clearColor];

damrem commented 5 years ago

@EsdrasEtrenne 's solution works fine. I did this to "freeze" the version I depend on to today's master :

"react-native-photo-view": "github:alwx/react-native-photo-view#e28f541",

But it would be great to release today's master on npm!

damrem commented 5 years ago

I did PR #172, for release purpose, I increased minor instead of patch because there were other changes since last npm release (1.5.2).