Reputation: 602
I have a UIView
and some Buttons
on a Xamarin Page
, and I need to find the Width and Height of the UIView
not the Frame
.
Are there any ways to solve this?
Upvotes: 2
Views: 4605
Reputation: 1294
If you want to get the view's size:
float viewWidth = view.Frame.Width;
float viewHeight = view.Frame.Height;
If you want to get the whole page's size:
float screenWidth = UIScreen.MainScreen.Bounds.Width;
float screenHeight = UIScreen.MainScreen.Bounds.Height;
Hope it can help you.
Upvotes: 0
Reputation: 545
int width = self.view.frame.size.width
int height = self.view.frame.size.height
So when you get the frame you can get the width and the height.
Upvotes: 4