iphone - How do you change the size of the components in a uipicker -


i have picker returning 3 components. told can change size of views doing following, not sure how implement this... implementing uipickerviewdelegate method pickerview:widthforcomponent: method size components (probably 150, 20, , 150, or so).

i see in documentation set method this, dont know next?

- (cgfloat)pickerview:(uipickerview *)pickerview widthforcomponent:(nsinteger)component {  } 

for using have implement uipickerviewdelegate...... , assign pickerview.....

if method being written in same class creating pickerview...... write.....

pickerview.delegate = self; 

and in header implement delegate...

- (cgfloat)pickerview:(uipickerview *)pickerview widthforcomponent:(nsinteger)component {     if(component == 0)        return 150.0; else if(component == 1)        return 20.0; else if(component == 2)        return 150.0; else        return 150.0;  } 

components numbered left-to-right.

thanks,


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -