You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When developing with react-native, you need to manually adjust your app to look great on variety of different screen sizes. That's a tedious job.
20
+
When developing with react-native, you need to manually adjust your app to look great on a variety of different screen sizes. That's a tedious job.
21
21
react-native-size-matters provides some simple tooling to make your scaling a whole lot easier.
22
22
The idea is to develop once on a standard ~5" screen mobile device and then simply apply the provided utils.
23
-
📖 You can read more about what led to this library on my blog post, that can be found in [this repo](./examples/BlogPost) or at [Soluto Engineering Blog](https://blog.solutotlv.com/size-matters/).
23
+
📖 You can read more about what led to this library on my blog post, which can be found in [this repo](./examples/BlogPost) or at [Soluto Engineering Blog](https://blog.solutotlv.com/size-matters/).
24
24
25
25
## Api
26
26
### Scaling Functions
@@ -37,12 +37,12 @@ const Component = props =>
37
37
38
38
39
39
*`scale(size: number)`
40
-
Will return linear scaled result of the provided size, based on your device's screen width.
40
+
Will return a linear scaled result of the provided size, based on your device's screen width.
41
41
*`verticalScale(size: number)`
42
-
Will return linear scaled result of the provided size, based on your device's screen height.
42
+
Will return a linear scaled result of the provided size, based on your device's screen height.
43
43
44
44
*`moderateScale(size: number, factor?: number)`
45
-
Sometimes you don't want to scale everything in a linear manner, that's where moderate scale comes in.
45
+
Sometimes you don't want to scale everything in a linear manner, that's where moderateScale comes in.
46
46
The cool thing about it is that you can control the resize factor (default is 0.5).
47
47
If normal scale will increase your size by +2X, moderateScale will only increase it by +X, for example:
You can clone the [expo-example-app](./examples/expo-example-app) from this repo, run `npm install` and `npm start` and scan the presented QR code in the [Expo app](https://expo.io) on your preferred device.
100
-
The app has a on/off switch for using `react-native-size-matters`, so you can test yourself how the app will look with and without scaling.
100
+
The app has an on/off switch for using `react-native-size-matters`, so you can test yourself how the app will look with and without scaling.
101
101
It is expected to look good on every device you want - iOS or Android, phone or tablet, basically anything (please let me know if not).
102
102
There are also some attached screenshots in the repo if you don't feel like cloning.
0 commit comments