在系统偏好设置 -> OS X 上的显示中,可以设置连接屏幕的旋转。
无论如何我可以以编程方式设置这个值吗?
我可以使用 CGDisplayRotation 获取当前设置。我似乎能够在一个简单的事务中设置许多屏幕属性,例如分辨率:
CGDisplayConfigRef config;
CGError error = CGBeginDisplayConfiguration(&config);
...
error = CGCompleteDisplayConfiguration(config, kCGConfigurePermanently);
...但无论如何我都找不到设置这个特定属性。
有谁知道这样做的方法?