gbumps / react-native-screenguard

A Native screenshot blocking library for React-Native developer, with background customizable after captured. Screenshot detector are also supported.
https://gbumps.github.io/react-native-screenguard/
MIT License
231 stars 28 forks source link

Image alignment does not seem to work #67

Closed RikSchefferAmsterdam closed 4 months ago

RikSchefferAmsterdam commented 4 months ago

I cannot get the image alignment seem to work properly. I always get my image in the top left corner. With and without setting an alignment. This is my code:

        ScreenGuard.registerWithImage({
          backgroundColor: '#ff0000'
          defaultSource: require('./bootsplash_logo.png'),
          source: {
            uri: 'some uri',
          },
          height: 59,
          width: 167,
          // alignment: 4,
        })

I can get it positioned with using top and left, but that is not ideal:

        ScreenGuard.registerWithImage({
          backgroundColor: '#ff0000'
          defaultSource: require('./bootsplash_logo.png'),
          source: {
            uri: 'some uri',
          },
          height: 59,
          width: 167,
          top: (Dimensions.get('screen').height - 59) / 2,
          left: (Dimensions.get('screen').width - 167) / 2,
        })

I only tested on iOS

gbumps commented 4 months ago

on which react-native version, iOS, Android version ? Please be more specifics.

RikSchefferAmsterdam commented 4 months ago

react-native: 0.74.3 iOS: 17.5.1

gbumps commented 4 months ago

I'm closing and move to the newly created issue with the registerWithImage. Please follows up #68

gbumps commented 4 months ago

reproduced on iOS 17.5.1, below not yet detected.

gbumps commented 4 months ago

released and fixed on 1.0.2. Please install and rebuild

Thanks!