我正在尝试制作适用于iPhone和iPad的应用程序.我正在寻找如何使两者兼容的接口.当应用程序加载时,我正在显示表格视图.如何根据设备加载不同的笔尖?我用这个来切换笔尖.
if ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)])
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
{
device = @"iPad";
}
else
{
device = @"iPhone";
}
}
Run Code Online (Sandbox Code Playgroud)
但在MainWindow.xib中,它表示视图是从iPhone的视图控制器加载的.我可以根据设备制作这种动态吗?即我想从应用程序的开始显示基于设备的不同笔尖.谢谢.