有没有办法获取当前所选UIPickerView项目的框架?
我尝试了以下内容(如下所示),但我总是得到一个零回复:
-(void) pickerView:(UIPickerView *)pickerView
didSelectRow:(NSInteger)row
inComponent:(NSInteger)component{
UIView *selected = [pickerView viewForRow:row forComponent:component];
}
答案 0 :(得分:3)
UIView *view=[picker viewForRow:[picker selectedRowInComponent:1] forComponent:1];
CGRect viewframe=[view frame];