2017-03-12 67 views
2

使用angular/flex-layoutangular/material2fxLayoutAlign="stretch"指令似乎被破壞。但是,fxLayoutAlign="start"fxLayoutAlign="end"指令按預期工作。請檢查這個plnkrAngularJS組件佈局引擎fxLayoutAlign =「stretch」不起作用

fxLayoutAlign="stretch"documented爲:

每條線將延伸到填充剩餘的空間。

這是一個問題:

  1. Flex的佈局引擎?
  2. 角度分量佈局引擎?
  3. 我的代碼?
+0

有什麼用「拉伸」的?在文檔中找不到它https://github.com/angular/flex-layout/wiki/Declarative-API-Overview – lin

+0

Thx!這看起來對我來說就像它所做的一樣。你的盒子在不同的行中。該文件說:「它只適用於存在flex-wrap:wrap的情況,以及是否有多行flexbox items.'這是你的plnkr沒有提供的。 – lin

回答

0

你在找什麼只是flex佈局'中心'。 'stretch'適用於多行容器。

它僅適用,如果flex-wrap: wrap是存在的,如果有是Flexbox的物品多行

<md-card> 
     <md-card-subtitle>fxLayoutAlign="center"</md-card-subtitle> 
     <md-card-content> 
      <div fxLayout="row" fxFlex="100" fxLayoutAlign="center"> 
       <md-slide-toggle>One</md-slide-toggle> 
       <md-slide-toggle>Two</md-slide-toggle> 
      </div> 
     </md-card-content> 
    </md-card>