-1
我如何獲得UI_USER_INTERFACE_IDIOM,我不清楚它是如何工作的,任何人都可以引導我嗎?我如何獲得UI_USER_INTERFACE_IDIOM
我如何獲得UI_USER_INTERFACE_IDIOM,我不清楚它是如何工作的,任何人都可以引導我嗎?我如何獲得UI_USER_INTERFACE_IDIOM
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
// iPad device
} else {
// iPhone/iPod touch device
}
從Apple頭文件:
/* The UI_USER_INTERFACE_IDIOM() macro is provided for use when deploying to a version of the iOS less than 3.2. If the earliest version of iPhone/iOS that you will be deploying for is 3.2 or greater, you may use -[UIDevice userInterfaceIdiom] directly. */
#define UI_USER_INTERFACE_IDIOM() ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)] ? [[UIDevice currentDevice] userInterfaceIdiom] : UIUserInterfaceIdiomPhone)
做ü意味着代碼?或者想了解這個概念 – 2011-09-30 06:27:40