zoukankan      html  css  js  c++  java
  • Ionic3学习笔记(三)禁止横屏

    本文为原创文章,转载请标明出处

    目录

    1. 安装
    2. 使用
    3. 参数

    1. 安装

    命令行输入

    ionic cordova plugin add cordova-plugin-screen-orientation
    npm install --save @ionic-native/screen-orientation
    

    ./src/app/app.module.ts 中添加

    import {ScreenOrientation} from "@ionic-native/screen-orientation";
    

    provides 中添加

    ScreenOrientation,
    

    2. 使用

    ./config.xml 中添加

    <preference name="Orientation" value="portrait" />
    

    3. 参数

    portrait-primary        =>      不允许副竖屏
    portrait-secondary      =>      不允许副竖屏
    landscape-primary       =>      不允许副竖屏
    landscape-secondary     =>      不允许副竖屏
    portrait                =>      允许主竖屏和副竖屏
    landscape               =>      允许主横屏和副横屏
    any                     =>      所有都允许
    

    如有不当之处,请予指正,谢谢~

  • 相关阅读:
    spring guides
    Go 汇编入门
    go内存管理
    websocket
    Scheduling In Go
    log-structured-merge-trees
    InfluxDB 内部机制解析
    thread-states
    MySQL高可用方案
    Amazon Aurora解读
  • 原文地址:https://www.cnblogs.com/metaphors/p/7616573.html
Copyright © 2011-2022 走看看