有不明白的地方欢迎入群
347636249
探讨
using System;
//
using MonoTouch.UIKit;
using MonoTouch.Foundation;
using System.Drawing;
namespace GCForum
{
public class MyTestVC :UIViewController
{
public MyTestVC ()
{
}
private UISlider _slider;
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
this.View.BackgroundColor = UIColor.White;
UILabel lbl = chongqing.ControlCenter.CreateLbl (new RectangleF (10, 100, 150, 20), "");
this.View.Add (lbl);
_slider = new UISlider {
Frame = new RectangleF(10,10,this.View.Frame.Width-20,50)
};
_slider.MinValue = 0.0f;
_slider.MaxValue = 20.0f;
_slider.SetValue (10.0f, false);
lbl.Text = _slider.Value.ToString ();
//注册VlueChange事件
_slider.ValueChanged += (s,e) => {
lbl.Text = _slider.Value.ToString ();
};
this.View.Add (_slider);
}
//...
}
}