I am using angular material and want to design a layout for my application.
An
It's not enough to set overflow: scroll
.
You need to add position: absolute
and to set a size of your container that need to be scrollable. Try something like this:
md-content{
position: absolute;
height: 100px;
}
For more information of scrolling containers read this answer
Thanks.
try adding style="overflow: scroll;"
to the tag you wish to be scrollable.
For example I have in mine:
<div layout="column" flex style="overflow: scroll;">
<div id="content" ng-view flex></div>
</div>
What worked for me was as follows. An easy way is,
<div style="left:0;
top: 0;
overflow: auto;
min-height:auto;
max-height:100%;
height:300px;">
Or add it as external css.
The trick is of overflow. If the data on page overflows, it will automatically become scrollable.
Also it will only make the data scrollable that will be in the div as shown below.
UPDATE
This problem no longer appears with Angular-Material 1.1.1 - the original question was at the time of version 0.8.3
ORIGINAL
Use md-content on the outer elements as well.
<body ng-app="starterApp" layout="column" layout-fill>
<div flex="30" style="border: 1px solid darkgrey;background-color: #1CA9F0;"></div>
<md-content flex style="border: 1px solid firebrick;" layout="column">
<div flex="5" layout="row" layout-align="center">
<md-toolbar flex="50">
<h2 class="md-toolbar-tools">
<span>Toolbar</span>
</h2>
</md-toolbar>
</div>
<md-content flex layout="row" layout-align="center">
<md-content flex="50">
...
</md-content>
</md-content>
</md-content>
<div flex="5" style="border: 1px solid turquoise;"></div>
...
</body>
[Plunkr] http://plnkr.co/edit/IfEtX638z4ymccC0Ua53?p=preview
See: https://github.com/angular/material/issues/1906
I solve this problem (angular material 0.11.0)
index.html
<body ng-app="app" layout="column" >
<div flex layout="column" ng-include="'app/layout/shell.html'" ></div>
<body>
shell.html
<div layout="row" flex style="overflow: hidden;" ng-controller="Shell" layout-fill>
<div ng-include="'app/layout/left-side-nav.html'"></div>
<md-content flex layout="column" role="main" class="fondo" style="height: inherit">
<div ng-include="'app/layout/app-toolbar.html'"></div>
<md-content flex style="background-color: transparent; flex-direction: column;" ng-hide="dataLoading.init">
<div ui-view style="background-color: transparent"></div>
</md-content>
</md-content>
<div ng-include="'app/layout/right-side-nav.html'"></div>
</div>
To make the md-content scrollable, add the md-scroll-y attribute, like this:
<md-content md-scroll-y>
</md-content>