0

如何UIPickerView使用压缩单元进行压缩?我的意思是当我压缩时,UIPickerView我的单元格文本也会被压缩或拉伸。有谁能够帮我 ?我用

dataPickerView.transform = CGAffineTransformMakeScale(1.0, 0.5);

压缩UIPickerView.

4

1 回答 1

0

您必须实现 viewForRow 方法才能这样做。

-(UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view {

UILabel *label=[[UILabel alloc]init];
[label setNumberOfLines:NSIntegerMax];
[label setText:[array objectAtIndex:row]];
return label;

}

于 2012-12-27T10:46:40.610 回答