¡@

Home 

2014/10/15 ¤U¤È 10:11:10

iphone Programming Glossary: longeststring

Custom UIPickerView with three Components each showing label on Selection Indicator

http://stackoverflow.com/questions/16734557/custom-uipickerview-with-three-components-each-showing-label-on-selection-indica

for the given component. void addLabel NSString labeltext forComponent NSUInteger component forLongestString NSString longestString @end and In the .m file... LabeledPickerView.m LabeledPickerView #import LabeledPickerView.h @implementation LabeledPickerView.. but also add what will be the longest label we will use in updateLabel If you do not plan to update label then the longestString should be the same as the labelText This way we can initially size our label to the longest width and we get the same effect.. same effect Apple uses void addLabel NSString labeltext forComponent NSUInteger component forLongestString NSString longestString labels setObject labeltext forKey NSNumber numberWithInt component NSString keyName NSString stringWithFormat @ @_ @ @ longestString..