与角料动态高度压片滚动的内容元素元素、高度、动态、内容

2023-09-13 04:56:24 作者:何必念念不忘丶

此问题已经拿出several ŧ输入法的的角材料,但我没能做出任何V1.0.5的建议工作。整个页面(或Flex容器)滚动,移动卡拿出来看。

This question has come up several times during the evolution of Angular Material, but I'm not able to make any of the suggestions work for v1.0.5. The entire page (or flex container) scrolls, moving the tabs out of view.

我如何能实现滚动,全高含量的元素呢?

How can I achieve scrollable, full-height content elements?

<div flex>
    <md-tabs md-dynamic-height md-border-bottom>
        <md-tab label="one">
            <md-content class="md-padding">

演示小提琴

奖金为噶结合自定义滚动的。

推荐答案

我的工作了。通过删除动态高度指令,然后使用绝对定位,它的工作:

I've worked it out. By removing the dynamic-height directive, then using absolute positioning, it's working:

.tabs-wrapper {
    position: relative;
}
.full-size {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

<div ng-app="sandbox">
    <div flex class="tabs-wrapper">
        <md-tabs class="full-size" md-border-bottom>

小提琴演示

绝对定位需要获得柔性元素的子扩大。

注:高度在小提琴演示不正确。不会发生在我的项目这一问题。

Note: The height is incorrect in the fiddle demo. This problem doesn't occur in my project.