2011-01-31 22 views
5

Quando creo un nuovo UIDatePicker con la relativa modalità impostata su CountDownTimer, presenta uno scarso rendimento con uno sfondo nero. Qualcuno ha qualche intuizione? enter image description hereIOS: UIDatePicker esegue il rendering scarsamente con uno sfondo nero

Normale Picker assomiglia a questo:

enter image description here

CODICE: Nota l'UIButton un pulsante pieno schermo dietro il selettore per chiudere la vista

intervalPicker = new UIDatePicker(new RectangleF(0, this.tvc.View.Bounds.Height - 135, this.tvc.View.Bounds.Width, 200)); 
intervalPicker.Mode = UIDatePickerMode.CountDownTimer; 
intervalPicker.CountDownDuration = DeviceSession.CurrentBehavioralEvent.Duration*60; 

intervalPicker.ValueChanged += new EventHandler(intervalPicker_EditingChanged); 
UIButton b = UIButton.FromType(UIButtonType.Custom); 
b.Opaque = false; 
b.BackgroundColor = UIColor.Clear; 
b.Frame = new RectangleF(0, 0, this.tvc.View.Bounds.Width, this.tvc.View.Bounds.Height); 
b.TouchUpInside += (o, s) => { 
    intervalPicker.RemoveFromSuperview(); 
     b.RemoveFromSuperview(); 
    }; 

this.tvc.NavigationController.View.AddSubview(b); 
this.tvc.NavigationController.View.AddSubview(intervalPicker); 
+0

pubblicare il codice che si sta utilizzando. – WrightsCS

+0

Ho pubblicato il codice sopra. –

risposta

6

L'UIDatePicker in La modalità CountDownTimer viene visualizzata in questo modo quando si imposta un'altezza del frame inferiore a 216. Le altre modalità non presentano questo problema.

Il tuo esempio è la creazione di l'altezza a 200.

Cambiare l'altezza a 216.

+0

OMG sei rock. Ha funzionato perfettamente Ho battuto la testa su questo ... –

+0

Grazie. Questo bug è stato risolto in iOS7, ma è ancora disponibile in iOS6 – somedev

+0

Ci scusiamo per aver aggiunto un commento anche a me, ma questo mi ha appena salvato circa un giorno di lavoro! Grazie. – JamesSugrue

Problemi correlati