zoukankan      html  css  js  c++  java
  • In a Web Application and Mobile (hybrid), how to know which this platform running?

     needed depending on the platform to change the CSS to suit the size of the font.

     for example the DbGrid

    Hi

     You can try this js code to check platform. Add MainForm's Script properties.

    
      var userAgent = navigator.userAgent || navigator.vendor || window.opera;
    
      if( userAgent.match( /iPad/i ) || userAgent.match( /iPhone/i ) || userAgent.match( /iPod/i ) )
      {
    		//call your css in here for ios
    
      }
      else if( userAgent.match( /Android/i ) )
      {
    	//call your css in here for android
     }
      else
      {
       //call your css in here for other
      }
    }

    But why do you check platform? You can change css rules using media queries in css.

    For example

    @media screen and (min-width: 480px) {
        body {
            background-color: lightgreen;
        }
    }

    also you can create an hybrid project. Examine Demos/Touch/Hybrid demo.

     And you can change layout on clientside. Examine Demos/Desktop/Clientside Alignment - ... demos.

    On server side you can use :

    UniApplication.UniPlatform: TUniPlatforms
    TUniPlatform = (upDesktop, upMobile, upPhone, upTablet, upAndroid, upiPhone, upiPad, upiPod, upiOS);
     TUniPlatforms = set of TUniPlatform;
  • 相关阅读:
    HDU 1198
    HDU 1863
    HDU 1879
    HDU 1233
    HDU 1232
    HDU 1829
    HDU 2473
    hdu 1829 A Bug's Life
    hdu 3038 How Many Answers Are Wrong
    hdu 1198 Farm Irrigation
  • 原文地址:https://www.cnblogs.com/wxb-km/p/5442622.html
Copyright © 2011-2022 走看看