appsome / AccordionView

Simple accordion view in Cocoa Touch
Other
144 stars 38 forks source link

UIPickerView is rendered before item is expanded #16

Closed gerasimos closed 9 years ago

gerasimos commented 10 years ago

Hello,

I tried to put a UIPickerView in the accordion:

[accordion addHeader:header2 withView:pickerView];

What happens is that the picker view is rendered before the selected item is actually expanded. Try to change

UIView *view2 with UIPickerView in test/ViewController.m to reproduce it.

Best, Gerasimos

suda commented 9 years ago

UIPickerView's height can't be changed after initialisation. You have to put it in a separate UIView to have clipping working:

UIView *view2 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, 200)];
UIPickerView *picker = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 0, 0, 200)];
[view2 addSubview:picker];
[accordion addHeader:header2 withView:view2];