如何在离子2中产生响应离子网格

时间:2016-12-31 21:20:59

标签: ionic-framework responsive-design ionic2

我有一张卡片列表,我需要在小型设备的1列中显示它们,在中型设备中显示2列,在大型设备中显示3列

基于https://stackoverflow.com/a/36432126/2279488https://stackoverflow.com/a/36432126/2279488我尝试了下面的代码,但最后没有成功。

1

 <ion-row  responsive-sm>
    <ion-col *ngFor="let card of cards" width-50>
      <ion-card >

在小型设备上显示正确,在大型和中型上它只显示2张卡

2

  <ion-row  responsive-sm>
    <ion-col  width-50>
      <ion-card *ngFor="let card of cards">

在小型设备上显示正确,大型和中型1列显示,所有卡都在列

3

  <ion-row  responsive-sm>
    <ion-col>
      <ion-card *ngFor="let card of cards">

在小型设备上显示正确,在中型和大型上它只显示1列,卡显示在该列中

2 个答案:

答案 0 :(得分:0)

我找到了解决方案,以防其他人遇到同样问题

我在第一段代码中添加了包装,但它确实有效。

 File "holt.py", line 7, in <module>
from tensorflow import tf


File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *


 File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 91, in <module>
from tensorflow.python.summary import summary


 File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/summary/summary.py", line 41, in <module>
from google.protobuf import json_format as _json_format
ImportError: cannot import name json_format

答案 1 :(得分:0)

我在我的HTML下面添加了代码,它为我工作。

03-22 11:30:09.336 11079-11191/cybdom.kkjhljh E/ActivityThread: Failed to find provider info for com.google.android.gms.chimera
03-22 11:30:09.486 11079-11191/cybdom.kkjhljh E/NetworkRqFactoryProxy: NetworkRequestFactoryProxy failed with a RemoteException:
                                                                       com.google.android.gms.dynamite.DynamiteModule$zza: No acceptable module found. Local version is 0 and remote version is 0.
                                                                           at com.google.android.gms.dynamite.DynamiteModule.zza(Unknown Source)
                                                                           at com.google.android.gms.dynamite.DynamiteModule.zza(Unknown Source)
                                                                           at com.google.android.gms.internal.zzbre.<init>(Unknown Source)
                                                                           at com.google.android.gms.internal.zzbre.zzj(Unknown Source)
                                                                           at com.google.firebase.storage.StorageReference.zzaaN(Unknown Source)
                                                                           at com.google.firebase.storage.UploadTask.zzaba(Unknown Source)
                                                                           at com.google.firebase.storage.UploadTask.run(Unknown Source)
                                                                           at com.google.firebase.storage.StorageTask$8.run(Unknown Source)
                                                                           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
                                                                           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
                                                                           at java.lang.Thread.run(Thread.java:856)
03-22 11:30:09.486 11079-11191/cybdom.kkjhljh E/UploadTask: Unable to create a network request from metadata
                                                            android.os.RemoteException
                                                                at com.google.android.gms.internal.zzbre.<init>(Unknown Source)
                                                                at com.google.android.gms.internal.zzbre.zzj(Unknown Source)
                                                                at com.google.firebase.storage.StorageReference.zzaaN(Unknown Source)
                                                                at com.google.firebase.storage.UploadTask.zzaba(Unknown Source)
                                                                at com.google.firebase.storage.UploadTask.run(Unknown Source)
                                                                at com.google.firebase.storage.StorageTask$8.run(Unknown Source)
                                                                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
                                                                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
                                                                at java.lang.Thread.run(Thread.java:856)
03-22 11:30:09.486 11079-11191/cybdom.kkjhljh E/StorageException: StorageException has occurred.
                                                                  An unknown error occurred, please check the HTTP result code and inner exception for server response.
                                                                   Code: -13000 HttpResult: 0
03-22 11:30:09.486 11079-11191/cybdom.kkjhljh E/StorageException: null
                                                                  android.os.RemoteException
                                                                      at com.google.android.gms.internal.zzbre.<init>(Unknown Source)
                                                                      at com.google.android.gms.internal.zzbre.zzj(Unknown Source)
                                                                      at com.google.firebase.storage.StorageReference.zzaaN(Unknown Source)
                                                                      at com.google.firebase.storage.UploadTask.zzaba(Unknown Source)
                                                                      at com.google.firebase.storage.UploadTask.run(Unknown Source)
                                                                      at com.google.firebase.storage.StorageTask$8.run(Unknown Source)
                                                                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
                                                                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
                                                                      at java.lang.Thread.run(Thread.java:856)
03-22 11:30:09.486 11079-11191/cybdom.kkjhljh E/StorageException: StorageException has occurred.
                                                                  An unknown error occurred, please check the HTTP result code and inner exception for server response.
                                                                   Code: -13000 HttpResult: 0
03-22 11:30:09.486 11079-11191/cybdom.kkjhljh E/StorageException: null
                                                                  android.os.RemoteException
                                                                      at com.google.android.gms.internal.zzbre.<init>(Unknown Source)
                                                                      at com.google.android.gms.internal.zzbre.zzj(Unknown Source)
                                                                      at com.google.firebase.storage.StorageReference.zzaaN(Unknown Source)
                                                                      at com.google.firebase.storage.UploadTask.zzaba(Unknown Source)
                                                                      at com.google.firebase.storage.UploadTask.run(Unknown Source)
                                                                      at com.google.firebase.storage.StorageTask$8.run(Unknown Source)
                                                                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
                                                                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
                                                                      at java.lang.Thread.run(Thread.java:856)