【问题标题】:How to detect if the user device big or small in Ionic 2如何在 Ionic 2 中检测用户设备是大还是小
【发布时间】:2017-09-28 11:17:18
【问题描述】:

基本上我想写一个函数来检测设备的大小,无论它是大是小

例如: 三星 S6、S7、S8 不允许使用 iPad 或三星 Tab 等尺寸不大的功能。

【问题讨论】:

    标签: ionic2 size screen device platform


    【解决方案1】:

    您可以为此使用Platform.is()

    import { Platform } from 'ionic-angular';
    
    constructor(public platform: Platform)
    
    public myFunction(){
      if(this.platform.is('tablet'){
        //execute function
      }
    }
    

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 2019-12-31
      • 2013-06-02
      • 2011-09-15
      • 1970-01-01
      • 1970-01-01
      • 2017-09-10
      • 2011-05-19
      • 2017-05-09
      • 1970-01-01
      相关资源
      最近更新 更多