2011-01-31 21 views
5

ModeをCountDownTimerに設定して新しいUIDatePickerを作成すると、黒い背景で表示が不十分になります。誰もが洞察力を持っていますか? enter image description hereIOS:UIDatePickerが黒い背景でうまくレンダリングされない

ノーマルピッカーは次のようになります。

enter image description here

CODE:

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

ポストまでの高さは、使用しているコード200

変更に高さを設定しています。 – WrightsCS

+0

私は上記のコードを掲載しました。 –

答えて

6

ビューを却下するUIButtonは、ピッカーの背後にあるフルスクリーンボタンであることに注意してくださいUIDatePickerでCountDownTimerモードは、フレームの高さを216未満に設定すると、この方法で表示されます。他のモードにはこの問題はありません。

あなたの例では、216

+0

OMGあなたは揺れる。完璧に働いた。私はこの1つに私の頭を打っている... –

+0

ありがとう。このバグはiOS7で修正されましたが、iOS6でもまだ利用可能です – somedev

+0

私のコメントを追加することについて謝罪しますが、これでちょうど私の仕事が節約されました!ありがとう。 – JamesSugrue

関連する問題