Upgrade to Pro — share decks privately, control downloads, hide ads and more …

React Nativeのレイアウトエンジン YogaでFlexible box layout...

mottox2
June 26, 2018

React Nativeのレイアウトエンジン YogaでFlexible box layoutレイアウトを作る / yoga-with-sketch

[訂正] Flexbox => Flexible box layout

[Yoga Layout | Playground](https://yogalayout.com/playground/)

最高に役に立たないJSONからSketchファイルを作るリポジトリです。
[mottox2/json-sketchapp: Sketch Plugin: Convert JSON file to Sketch file](https://github.com/mottox2/json-sketchapp)

mottox2

June 26, 2018
Tweet

More Decks by mottox2

Other Decks in Programming

Transcript

  1. @mottox2 • React, Ruby on RailsΛத৺ʹWebαʔϏε։ൃ͍ͯ͠·͢ • ReactNative΋৭ʑݴΘΕ͍ͯΔ͚Ͳ޷͖Ͱ͢ • UI

    EngineeringʹڵຯΞϦ • ϒϩά΍ͬͯ·͢(esa.io + note.mu + GatsbyJS) => mottox2.com Freelance web engineer Yuki Takemoto
  2. Yoga ͱ͸ʁ Yoga is a cross platform layout engine implementing

    Flexbox • https://yogalayout.com/͋ • Facebook੡ • FlexboxϥΠΫͳAPIΛ࣋ͬͨϨΠΞ΢τΤϯδϯ • React NativeɺComponent Kit (iOS)ɺLitho (Android)ͳͲͷϥΠϒϥϦͷ಺෦Ͱ࢖ ΘΕ͍ͯΔɻa͋ • ୯ମͰ΋࢖͏͜ͱ͕Ͱ͖Δɻࠓճ͸JS୯ମͰѻ͍͖ͬͯ·͢ɻ Yoga͸Flexbox࣮૷ͷΫϩεϓϥοτϑΥʔϜϨΠΞ΢τΤϯδϯ
  3. Yogaͷ֓೦ ~Layout~ • left, right, top, bottom, width, heightΛ࣋ͭΦϒδΣΫτ •

    Node.getComputedLayout΍Node.getComputedXXX(ex. Left, Width)ؔ਺Ͱऔಘ Ͱ͖Δɻ • calculateLayoutΛ࣮ߦ͢Δ·ͰLayout͸औಘͰ͖ͳ͍ɻ(JSͷ৔߹NaN͕ฦΔ)