Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

percentage width react native

// Firstly, import Dimensions, and save the window's width and height 
import {Dimensions} from "react-native";

var width = Dimensions.get("window").width; 
var height = Dimensions.get("window").height; 

// Then inside your stylesheet you can use something like this:
width: width * 0.9, // Sets width to 90%
 
PREVIOUS NEXT
Tagged: #percentage #width #react #native
ADD COMMENT
Topic
Name
8+1 =