Question

I have a UIPickerView that i positioned from Storyboard. And i got this code to place it outside of the view bounds

- (void)awakeFromNib
{
[super awakeFromNib];
self.categoryPicker.frame = CGRectMake(0, self.view.bounds.size.height, 320, 162);
}

but when i run the app the pickerView doesn't seems to move at all.

Any advice? thanks

Était-ce utile?

La solution 2

So after a bit of work any some good advice, the problem was solved.

The auto layout was turned-on, and once i turned it off could move the picker outside of the view's bounds.

Autres conseils

Seems to be that, your autoresizing mask is wrong. Try to set:

self.categoryPicker.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin;

and maybe:

self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top