c# - UIScreen.MainScreen.Bounds.Height and UIScreen.MainScreen.Bounds.Width are both 0 -
c# - UIScreen.MainScreen.Bounds.Height and UIScreen.MainScreen.Bounds.Width are both 0 -
i did , update xamarin ios project , utilize able phone call next code retrieve screen width , height:
if (orientation == uiinterfaceorientation.landscapeleft || orientation == uiinterfaceorientation.landscaperight) homecoming new rectanglef(uiscreen.mainscreen.bounds.x, uiscreen.mainscreen.bounds.y, uiscreen.mainscreen.bounds.height, uiscreen.mainscreen.bounds.width);
however update bounds set using cgrect code has changed this:
if (orientation == uiinterfaceorientation.landscapeleft || orientation == uiinterfaceorientation.landscaperight) homecoming new cgrect(uiscreen.mainscreen.bounds.x, uiscreen.mainscreen.bounds.y, uiscreen.mainscreen.bounds.height, uiscreen.mainscreen.bounds.width);
now when seek height , width returns 0. i've tried create new project , seek same thing run same problem. how can retrieve width , height of main screen?
this looks it's bug in visual studio plugin, it's been reported before: http://forums.xamarin.com/discussion/comment/80994/#comment_80994
the workaround utilize xamarin studio (on mac) in meantime.
it appreciated if file bug @ http://bugzilla.xamarin.com project can prepare it.
c# ios monotouch xamarin
Comments
Post a Comment