Ionic 2 响应式网格 [英] Ionic 2 responsive grid

查看:44
本文介绍了Ionic 2 响应式网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 Ionic 2 中制作响应式网格?Ionic 1 支持保留类,例如 responsive-mdresponsive-sm 使网格具有响应性,但它​​们在 Ionic 2 中似乎不起作用.

How can I make a responsive grid in Ionic 2? Ionic 1 supported reserved classes like responsive-md or responsive-sm that made grids responsive, but they don't seem to work in Ionic 2.

就我而言,我有一个 和三个 .当显示宽度低于阈值时,我希望列彼此低于对方.可以用 Ionic 2 做到这一点吗?

In my case I have an <ion-row> with three <ion-col>. I would like the columns to drop below each other when the display width drops below a threshold. Is it possible to do this with Ionic 2?

推荐答案

虽然它目前似乎没有出现在 Ionic 2 文档中,responsive-mdresponsive-sm(等)Ionic 1 中的类现在成为 Ionic 2 中的单独属性.

Though it does not seem to appear in the Ionic 2 documentation currently, the responsive-md, responsive-sm (etc.) classes in Ionic 1 now become individual attributes in Ionic 2.

这是一个例子:

  <ion-row responsive-sm>
    <ion-col width-10>This column will take 10% of space</ion-col>
  </ion-row>

这篇关于Ionic 2 响应式网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆