public override void ViewDidLoad() { base.ViewDidLoad(); Tracks = SampleTracks.GetTracks().ToArray(); BlackLeatherTheme.Apply(this); TableView.DataSource = new DataSource(this); }
private void AddButton(string options, string title) { UIButton button = new UIButton(new RectangleF(10, 120, 298, 57)); BlackLeatherTheme.Apply(button, options); button.SetTitle(title, UIControlState.Normal); View.AddSubview(button); }
public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell(cellKey); if (cell == null) { cell = new UITableViewCell(UITableViewCellStyle.Subtitle, cellKey); BlackLeatherTheme.Apply(cell); } Track track = this.Parent.Tracks[indexPath.Row]; cell.TextLabel.Text = track.TrackName; cell.DetailTextLabel.Text = track.ArtistName; cell.ImageView.Image = track.AlbumImage; return(cell); }
public override void LoadView() { View = new StackPanel(); BlackLeatherTheme.Apply(View); //Add Label UILabel textLabel = new UILabel(new RectangleF(15, 40, 200, 30)) { Text = "Label" }; BlackLeatherTheme.Apply(textLabel); View.AddSubview(textLabel); //Add TextField UITextField textField = new UITextField(new RectangleF(10, 80, 268, 30)) { Placeholder = "Text Input", ShouldReturn = (field) => { field.ResignFirstResponder(); return(true); } }; BlackLeatherTheme.Apply(textField); View.AddSubview(textField); AddButton("", "Normal Button"); AddButton("cancel", "Cancel Button"); AddButton("confirm", "Confirm Button"); //AddSlider(); UISlider slider = new UISlider(new RectangleF(10, 330, 298, 10)) { Value = 0.5f }; View.AddSubview(slider); }