【发布时间】:2015-12-21 22:35:17
【问题描述】:
我正在尝试角度材质,尤其是 flex 布局属性。
我有一个列布局,其中包含一个带有行布局的子 div,其中包含另外两个子项,其中一个具有 flex。
我想要的是第一个子项滚动,而不是第二个。
<div ng-app="app"
layout="column" class="demo" >
<md-toolbar>
<h2 class="md-toolbar-tools">
<span>Toolbar</span>
</h2>
</md-toolbar>
<md-content>
<div layout="row">
<md-card flex>
Load of content<br/>
Load of content<br/>
Load of content<br/>
Load of content<br/>
Load of content<br/>
Load of content<br/>
Load of content<br/>
Load of content<br/>
Load of content<br/>
Load of content<br/>
Load of content<br/>
Load of content<br/>
Load of content<br/>
Load of content<br/>
Load of content<br/>
Load of content<br/>
Load of content<br/>
Load of content<br/>
</md-card>
<div>dgfdgfdg</div>
</div>
</md-content>
</div>
当前实现 - http://codepen.io/anon/pen/merXpr
我注意到 md-content 指令可用于滚动内容,我尝试将包含我的两个子项的包含 div 包裹起来,但当然这只会使整个内容区域滚动。
有没有办法让 md-card 项目滚动?我确实尝试用 md-content 包装 md-card,但这没有任何区别。
谢谢
【问题讨论】:
-
将
position:fixedcss 提供给第二个子元素会起作用,但这是一种解决方法,不推荐
标签: angular-material