mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-28 08:07:25 +08:00
Add percentage support to react native
Summary:
Adds support for percentage value in react native.
syntax: property: 100 | property | '100%'
supported properties:
padding
margin
width
height
minWidth
minHeight
maxWidth
maxHeight
flexBasis
```
class Playground extends React.Component {
render() {
return (
<View style={{backgroundColor: 'white', padding: 10, paddingTop: 30, height: '100%'}}>
<Text>
If you want to quickly test out something,
open the Playground.js file and start coding.
</Text>
<View style={{backgroundColor: 'red', height: 50, width: 50}}/>
<View style={{backgroundColor: 'blue', height: '50%', width: '50%'}}/>
</View>
);
}
}
```
Reviewed By: astreet
Differential Revision: D4376549
fbshipit-source-id: c41d68a7555396f95d063a7527ee081773ac56dc
This commit is contained in:
committed by
Facebook Github Bot
parent
00d5674474
commit
3f49e743be
@@ -19,7 +19,7 @@ public class YogaValue {
|
||||
public final float value;
|
||||
public final YogaUnit unit;
|
||||
|
||||
YogaValue(float value, YogaUnit unit) {
|
||||
public YogaValue(float value, YogaUnit unit) {
|
||||
this.value = value;
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user