ios - UIPickerView content flowing unexpectedly -


i using uidatepicker , uipickerview in app. both controls showing weird behaviour. when scroll content in picker, flows outside picker , not scroll supposed to. implementation below.

sexarray = @[@"male", @"female"]; uipickerview *picker = [[uipickerview alloc] initwithframe:cgrectmake(0, 50, 100, 150)]; [picker setdatasource: self]; [picker setdelegate: self]; picker.showsselectionindicator = yes; gendertf.inputview = picker;   #pragma mark -- uipickerview methods  -(nsinteger)pickerview:(uipickerview *)pickerview numberofrowsincomponent:(nsinteger)component{ return sexarray.count; }  -(nsinteger)numberofcomponentsinpickerview:(uipickerview *)pickerview{ return 1; }  - (uiview *)pickerview:(uipickerview *)pickerview viewforrow:(nsinteger)row       forcomponent:(nsinteger)component reusingview:(uiview *)view { uilabel *retval = (uilabel*)view; if (!retval) {     retval = [[uilabel alloc] initwithframe:cgrectmake(0.0f, 0.0f, 100, [pickerview rowsizeforcomponent:component].height)]; }  retval.font = [uifont fontwithname:@"sourcesanspro-regular" size:15.0f]; retval.minimumscalefactor = 0.6; [retval settextalignment:nstextalignmentcenter]; retval.text = [sexarray objectatindex:row];  return retval; }  -(void)pickerview:(uipickerview *)pickerview didselectrow:(nsinteger)row incomponent:(nsinteger)component{ [gendertf settext:sexarray[component]]; } 

when same code used in app (for testing), works expected.

editing began

when content scrolled

turns out implementation correct on part. problem because of third party library.

i using pod slpagingview in project made `uipickerview' act weird. couldn't find solution , ended in replacing pod similar pod.

details link


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -