aとaUIActionSheetを含む があります。UIToolBar には完了ボタンがあります。ただし、コンポーネントを回転させて回転を停止する前に、ボタンをタップすると、値が取得されません。ピッカーがアニメーションの回転を停止した後にボタンをタップすると、選択したコンポーネントの値が取得されますpickerUIToolbarPickerDoneUITextfieldDone
アニメーションを停止する前にアイテムの値を取得する方法はありますか..?
解決する
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view
{
     UILabel *lbl = (UILabel *)view;
           // Reuse the label if possible...
           if ((lbl == nil) || ([lbl class] != [UILabel class])) {
               CGRect frame = CGRectMake(0.0, 10.0, 250, 50);
               lbl = [[[UILabel alloc] initWithFrame:frame] autorelease];
           }
    if (component == 0) {
        lbl.textColor = [UIColor blackColor];
        lbl.textAlignment=UITextAlignmentLeft;
        lbl.backgroundColor = [UIColor clearColor];
        lbl.text = [arrCountry objectAtIndex:row];
        lbl.font=[UIFont boldSystemFontOfSize:14];
         NSInteger clm1 = [pickerView2 selectedRowInComponent:component];
        txtCountry.text = [arrCountry objectAtIndex:clm1];
        countryCode=[arrCountryCode objectAtIndex:clm1];
    }
    return lbl;
}
そしてまた
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
  txtCountry.text = [arrCountry objectAtIndex:row];
  countryCode=[arrCountryCode objectAtIndex:row];
}