Thursday, August 4, 2016

7:37 PM



สำหรับการทำ apps ด้วย filemaker เราจำเป็นต้องสร้าง layout ให้พอดีกับขนาดของอุปกรณ์ ios ทุกตัว ดังงั้นจึงจำเป็นต้องทราบว่า ผู้ใช้งาน apps ของเรานั้น ใช้งานจาก idevice อะไร

มาดู function ในการตรวจสอบกันครับ สร้างโดยใช้ custom function ครับ

  1. Let (  
  2.   [  
  3.   ~device = Get ( Device ) ; // 3 = iPad , 4= iPhone  
  4.   ~screenHeight = Get ( ScreenHeight ) ;  
  5.   ~screenWidth = Get ( ScreenWidth ) ;  
  6.   ~screenSize = ~screenHeight + ~screenWidth  
  7.   ] ;  
  8.   
  9.   Case (  
  10.   ~device = 1 or ~device = 2 ;  
  11.     "Desktop" ;  
  12.   
  13.   ~device = 3 and ~screenSize ≥ 2390 ;  
  14.     "iPad Pro" ;  
  15.   ~device = 3 and ~screenSize ≥ 1792 ;  
  16.     "iPad" ;  
  17.   
  18.   ~device = 4 and ~screenSize ≥ 1150 ;  
  19.     "iPhone 6 Plus" ;  
  20.   ~device = 4 and ~screenSize ≥ 1042 ;  
  21.     "iPhone 6" ;  
  22.   ~device = 4 and ~screenSize ≥ 888 ;  
  23.     "iPhone 5"  
  24.   )  
  25. )  

Credit : https://community.filemaker.com/thread/150976



บทความอื่นๆ