
สำหรับการทำ apps ด้วย filemaker เราจำเป็นต้องสร้าง layout ให้พอดีกับขนาดของอุปกรณ์ ios ทุกตัว ดังงั้นจึงจำเป็นต้องทราบว่า ผู้ใช้งาน apps ของเรานั้น ใช้งานจาก idevice อะไร
มาดู function ในการตรวจสอบกันครับ สร้างโดยใช้ custom function ครับ
- Let (
- [
- ~device = Get ( Device ) ; // 3 = iPad , 4= iPhone
- ~screenHeight = Get ( ScreenHeight ) ;
- ~screenWidth = Get ( ScreenWidth ) ;
- ~screenSize = ~screenHeight + ~screenWidth
- ] ;
- Case (
- ~device = 1 or ~device = 2 ;
- "Desktop" ;
- ~device = 3 and ~screenSize ≥ 2390 ;
- "iPad Pro" ;
- ~device = 3 and ~screenSize ≥ 1792 ;
- "iPad" ;
- ~device = 4 and ~screenSize ≥ 1150 ;
- "iPhone 6 Plus" ;
- ~device = 4 and ~screenSize ≥ 1042 ;
- "iPhone 6" ;
- ~device = 4 and ~screenSize ≥ 888 ;
- "iPhone 5"
- )
- )
Credit : https://community.filemaker.com/thread/150976