UIPickerView选择项目的框架

时间:2011-07-09 11:08:37

标签: ios uipickerview

有没有办法获取当前所选UIPickerView项目的框架?

我尝试了以下内容(如下所示),但我总是得到一个零回复:

-(void) pickerView:(UIPickerView *)pickerView 
      didSelectRow:(NSInteger)row 
       inComponent:(NSInteger)component{


    UIView *selected = [pickerView viewForRow:row forComponent:component];
}

1 个答案:

答案 0 :(得分:3)

UIView *view=[picker viewForRow:[picker selectedRowInComponent:1] forComponent:1];


CGRect viewframe=[view frame];