SORU
11 AĞUSTOS 2009, Salı


UİPickerView & Action sayfasına bir Düğme ekleme?

Benim uygulama bir eylem sayfasına eklenecek aşağıdaki şeyler gerektirir.

  • UİToolbar
  • UİToolbar düğmesini tıklayın
  • UİPicker Kontrol

Benim gereksinimlerini anlamak için bir resim ekledim.

alt text

Bu nasıl uygulanabilir açıklayabilir misiniz?

CEVAP
15 Ocak 2010, Cuma


Bir daha çözüm:

  • hayır araç ama parçalı bir kontrol (şık bir görünüm)

    UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil 
                                                        delegate:nil
                                                        cancelButtonTitle:nil
                                                        destructiveButtonTitle:nil
                                                        otherButtonTitles:nil];
    
    [actionSheet setActionSheetStyle:UIActionSheetStyleBlackTranslucent];
    
    CGRect pickerFrame = CGRectMake(0, 40, 0, 0);
    
    UIPickerView *pickerView = [[UIPickerView alloc] initWithFrame:pickerFrame];
    pickerView.showsSelectionIndicator = YES;
    pickerView.dataSource = self;
    pickerView.delegate = self;
    
    [actionSheet addSubview:pickerView];
    [pickerView release];
    
    UISegmentedControl *closeButton = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObject:@"Close"]];
    closeButton.momentary = YES; 
    closeButton.frame = CGRectMake(260, 7.0f, 50.0f, 30.0f);
    closeButton.segmentedControlStyle = UISegmentedControlStyleBar;
    closeButton.tintColor = [UIColor blackColor];
    [closeButton addTarget:self action:@selector(dismissActionSheet:) forControlEvents:UIControlEventValueChanged];
    [actionSheet addSubview:closeButton];
    [closeButton release];
    
    [actionSheet showInView:[[UIApplication sharedApplication] keyWindow]];
    
    [actionSheet setBounds:CGRectMake(0, 0, 320, 485)];
    

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • GirlSanctuaryBlog

    GirlSanctuar

    28 Aralık 2011
  • iZAPPA

    iZAPPA

    16 Temmuz 2010
  • Paul Schroder

    Paul Schrode

    30 Kasım 2007