Domanda

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

È stato utile?

Soluzione 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.

Altri suggerimenti

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

self.categoryPicker.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin;

and maybe:

self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top