Search code examples
iosframepixelcgrect

How to use the .frame property in iOS?


I am calling a custom picker in my application when i hit a button.

The picker looks like a bubble so i am pointing it to the button like this :

thePicker.presentFromRect = button.frame;

I need the picker to show 300 pixels down from this button. How can i do that?

How can i add 300 pixels height on the above statement ?


Solution

  • You need to use :

    CGRect frame = self.window.frame;
    frame.size.height += 30;
    thePicker.presentFromRect = frame;