SORU
28 EKİM 2013, PAZARTESİ


o'in Olay ValueChanged iOS7 UİSwitch: sürekli bu Hata arayarak ya da ne..?

Edit

Şimdi tamir
Bunu düzeltmek için herhangi bir tweak yapma.

Edit2

Görünüşe göre aynı sorunu tekrar iOS 8.0 ve 8.1 olur


Merhaba Bugün gördüm UISwitch's Olay ValueChanged: Arama continuously iken ben değiştirmek için On Off Off ve benim parmak taşındı hala sağ tarafı ile sol tarafı. NSLog ile daha net GİF ben atteched.

enter image description here

Benim Değer Yöntemi Değişti:-

- (IBAction)changeSwitch:(id)sender{

    if([sender isOn]){
        NSLog(@"Switch is ON");
    } else{
        NSLog(@"Switch is OFF");
    }

}

Anahtarı aynı kod Sorun olarak çalışmaya beklenti: - iOS6

enter image description here

kimse bana tavsiye sadece bir kez Ara ya da kapalı durumda. ya da bu bir hata ya da ne..?

GÜNCELLEME

İşte benim Demo:-

programmatic Add UISwitch

from XIB adding UISwitch

CEVAP
28 EKİM 2013, PAZARTESİ


Aşağıda kodlama bakın lütfen

    - (void)viewDidLoad
{
      [super viewDidLoad];    
      UISwitch *mySwitch = [[UISwitch alloc] initWithFrame:CGRectMake(130, 235, 0, 0)];    
    [mySwitch addTarget:self action:@selector(changeSwitch:) forControlEvents:UIControlEventValueChanged];
    [self.view addSubview:mySwitch];
}

- (void)changeSwitch:(id)sender{
    if([sender isOn]){
        NSLog(@"Switch is ON");
    } else{
        NSLog(@"Switch is OFF");
    }
}

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

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Gee Cee

    Gee Cee

    1 AĞUSTOS 2009
  • GUN-TIME with Brandon

    GUN-TIME wit

    3 ŞUBAT 2009