开发者

UIPickerView selected item's frame

开发者 https://www.devze.com 2023-03-19 13:31 出处:网络
Is there a way to get the frame of the currently selected UIPickerView\'s item? I tried the following (as suggested below) but I always get a nil back:

Is there a way to get the frame of the currently selected UIPickerView's item?

I tried the following (as suggested below) but I always get a nil back:

-(void) pickerView:(UIPickerView *)pickerView 
      didSelectRow:(NSInteger)row 
       inComponent:(开发者_运维问答NSInteger)component{


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


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


CGRect viewframe=[view frame];
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号