Giter Site home page Giter Site logo

Comments (5)

rs4231199 avatar rs4231199 commented on May 31, 2024
import { Dimensions } from 'react-native';
const screenWidth = Dimensions.get('window').width;

I needed to set width equal to screen-width.

from react-native-skeleton-content.

v0lume avatar v0lume commented on May 31, 2024

@rs4231199 yes it works, but I think it's not a good solution, more like workaround

from react-native-skeleton-content.

ItsSander107 avatar ItsSander107 commented on May 31, 2024

I'd love this to be a thing. My current width is Dimensions.get('window').width - constants.styleSettings.paddedView * 2,. '100%' is a tad shorter.

from react-native-skeleton-content.

alexZajac avatar alexZajac commented on May 31, 2024

Hey @v0lume!
The issue is happening because since we are passing the child width/height properties to the transform property, it throws an error because the transfrom can't accept a percentage.
As @rs4231199 suggested, a quick workaround would be to init the desired witdh/height in a variable for each child having a different width/height.

I am currently searching for a solution to this problem, and I'll get back to you in the next few days.

from react-native-skeleton-content.

alexZajac avatar alexZajac commented on May 31, 2024

Hello guys, I have added support for percentages in the latest version (1.0.16). Closing the issue for now, and feel free to check it out and send your feedback!

from react-native-skeleton-content.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.