iphone - Having different locations of objects on a uiview -
i have application making uidatepicker
, uitoolbar
attached view. uitoolbar
has animation set slide up. problem is. on iphone 4 toolbar needs finish animation @ lower position on iphone 5. how set height differently each device?
you can distinguish iphone 5 iphone 4 this:
if([[uidevice currentdevice] userinterfaceidiom] == uiuserinterfaceidiomphone && [uiscreen mainscreen].bounds.size.height == 568.0){ //is iphone 5 } else{ //is iphone 4 }
then, set uitoolbar's frame appropriately each screen size.
also, here's macro convenience (put in .pch file):
#define is_4_inch_screen [[uidevice currentdevice] userinterfaceidiom] == uiuserinterfaceidiomphone && [uiscreen mainscreen].bounds.size.height == 568.0
Comments
Post a Comment