V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
qdwang
V2EX  ›  Swift

请教一个关于 Swift 的基础小问题

  •  
  •   qdwang · Aug 30, 2024 · 4275 views
    This topic created in 609 days ago, the information mentioned may be changed or developed.

    在锁屏幕方向的情况下,如何获取设备的方向呢?

    我试了网上各种方法都不行,用了官方文档说可以的UIDevice.current.orientation,也不行。。。

    1 replies    2024-09-25 14:51:40 +08:00
    chipmuck
        1
    chipmuck  
       Sep 25, 2024
    试试看换一种思路:

    将屏幕方向解锁,然后通过代码控制的方式来限定某些 View 的 orientation
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1485 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 16:22 · PVG 00:22 · LAX 09:22 · JFK 12:22
    ♥ Do have faith in what you're doing.