Skip to content
This repository has been archived by the owner on Dec 2, 2021. It is now read-only.

Latest commit

 

History

History
40 lines (34 loc) · 1.07 KB

NavBarLayout.md

File metadata and controls

40 lines (34 loc) · 1.07 KB

#NavBarLayout Navigation-bar layout consisting of optionally left and right items and a title in the middle.

When no item-width is specified, the width of the renderable itsself is used.

options type description
[margins] Margins Margins to use (see Margins)
[itemWidth] Number Width of the left & right items
[leftItemWidth] Number Width of the left items
[rightItemWidth] Number Width of the right items
[itemSpacer] Number Space in between items

Example:

var NavBarLayout = require('famous-flex/layouts/NavBarLayout');

new LayoutController({
  layout: NavBarLayout,
  layoutOptions: {
    margins: [5, 5, 5, 5], // margins to utilize
    itemSpacer: 10,        // space in between items
  },
  dataSource: {
    background: new Surface({properties: {backgroundColor: 'black'}}),
    title: new Surface({content: 'My title'}),
    leftItems:[
      new Surface({content: 'left1'})
    ],
    rightItems: [
      new Surface({content: 'right1'}),
      new Surface({content: 'right2'})
    ]
  }
})