电视的UIScreen是否有通过AppleTV和Airplay镜像连接的集合(点)大小?
或者根据实际的电视设备,appletv的屏幕是否有不同的尺寸?
发布于 2014-02-08 08:16:10
是,根据实际的电视设备,appletv的屏幕大小不同。
如果您想从设备中获取连接电视的大小,请按以下步骤操作:
通知中心
NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
[center addObserver:self selector:@selector(handleScreenDidConnectNotification:) name:UIScreenDidConnectNotification object:nil];连接通知
-(void)handleScreenDidConnectNotification : (NSNotification *)aNotification{
UIScreen *newScreen = [aNotification object];
CGRect screenBounds = newScreen.bounds;
// screenBounds --> Get the size from it
} https://stackoverflow.com/questions/21643614
复制相似问题