离子2响应网格 [英] Ionic 2 responsive grid
问题描述
如何在Ionic 2中制作响应式网格? Ionic 1支持保留类,如 responsive-md
或 responsive-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.
在我的情况下,我有一个< ion-row>
,其中有三个<离子-COL>
。当显示宽度低于阈值时,我希望列相互下降。 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-md < Ionic 1中的/ code>,
responsive-sm
(等)类现在成为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>
这篇关于离子2响应网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!