本文整理汇总了C#中MonoTouch类的典型用法代码示例。如果您正苦于以下问题:C# MonoTouch类的具体用法?C# MonoTouch怎么用?C# MonoTouch使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MonoTouch类属于命名空间,在下文中一共展示了MonoTouch类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCell
public override UITableViewCell GetCell (UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
{
var section = root.Sections [indexPath.Section];
var element = section.Elements [indexPath.Row];
return element.GetCell (tableView);
}
示例2: TouchesCancelled
/// <summary>
/// Called when the touches are cancelled due to a phone call, etc.
/// </summary>
public override void TouchesCancelled(MonoTouch.Foundation.NSSet touches, UIEvent evt)
{
base.TouchesCancelled (touches, evt);
// we fail the recognizer so that there isn't unexpected behavior
// if the application comes back into view
base.State = UIGestureRecognizerState.Failed;
}
示例3: GetCellImpl
protected override MonoTouch.UIKit.UITableViewCell GetCellImpl(MonoTouch.UIKit.UITableView tv)
{
//Implement binding of Title property in the business object to Caption propery of String Element
this.Bind(MvxBindingTouchView, DataContext, "{'Caption':{'Path':'Title'}}");
return base.GetCellImpl(tv);
}
示例4: TDBadgedCell
/// <summary>
/// Called by the TableView to get the actual UITableViewCell to render for the particular section and row
/// </summary>
/*
* public override UITableViewCell GetCell
(UITableView tableView, NSIndexPath indexPath)
{
TDBadgedCell cell = new TDBadgedCell (UITableViewCellStyle.Subtitle, "Cell");
cell.TextLabel.Text = contents[indexPath.Row].Title;
cell.TextLabel.Font = UIFont.BoldSystemFontOfSize (14);
cell.DetailTextLabel.Text = contents[indexPath.Row].Detail;
cell.DetailTextLabel.Font = UIFont.SystemFontOfSize (13);
cell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
cell.BadgeNumber = Convert.ToInt32 (contents[indexPath.Row].Badge);
if (indexPath.Row == 1)
cell.BadgeColor = UIColor.FromRGBA (1.000f, 0.397f, 0.419f, 1.000f);
if (indexPath.Row == 2)
cell.BadgeColor = UIColor.FromWhiteAlpha (0.783f, 1.000f);
return cell;
}
*/
public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
{
Console.WriteLine ("Calling Get Cell, isEditing:" + tableView.Editing);
//---- declare vars
TDBadgedCell cell = (TDBadgedCell)tableView.DequeueReusableCell (cellIdentifier);
//---- if there are no cells to reuse, create a new one
if (cell == null)
cell = new TDBadgedCell (UITableViewCellStyle.Subtitle, cellIdentifier);
//---- set the item text
cell.TextLabel.Text = tableItems [indexPath.Section].Items [indexPath.Row].activityType.activityTypeName;
DateTime dd = Tools.ConvertJavaMiliSecondToDateTime (tableItems [indexPath.Section].Items [indexPath.Row].lastDate);
if (tableItems [indexPath.Section].Items [indexPath.Row].lastDate > 0) {
cell.DetailTextLabel.Text = dd.ToLongDateString () + " - " + dd.ToShortTimeString();
cell.DetailTextLabel.Font = UIFont.SystemFontOfSize (11);
cell.Accessory = UITableViewCellAccessory.DetailDisclosureButton;
}
UIImage img = UIImage.FromFile ("Images/258-checkmark.png");
cell.ImageView.Image = img;
cell.BadgeNumber = Convert.ToInt32 (tableItems [indexPath.Section].Items [indexPath.Row].total);
if (indexPath.Row == 1)
cell.BadgeColor = UIColor.FromRGBA (1.000f, 0.397f, 0.419f, 1.000f);
if (indexPath.Row == 2)
cell.BadgeColor = UIColor.FromWhiteAlpha (0.783f, 1.000f);
if (indexPath.Row == 3)
cell.BadgeColor = UIColor.FromRGBA (1.000f, 0.333f, 0.666f, 1.000f);
return cell;
}
示例5: GetCell
public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
{
if (indexPath.Section < _viewModel.UpcomingSlots.Count)
{
var cell = tableView.DequeueReusableCell(OVERVIEW_SCHEDULE_CELL)
?? new UITableViewCell(UITableViewCellStyle.Subtitle, OVERVIEW_SCHEDULE_CELL);
var session = _viewModel.UpcomingSlots[indexPath.Section].Sessions[indexPath.Row];
cell.TextLabel.Text = session.Title;
if (string.IsNullOrEmpty(session.Speaker.Name))
cell.DetailTextLabel.Text = "Room: " + session.Room;
else
cell.DetailTextLabel.Text = string.Format("Room: {0}, {1}", session.Room, session.Speaker.Name);
cell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
return cell;
}
else
{
var cell = tableView.DequeueReusableCell(OVERVIEW_LINK_CELL)
?? new UITableViewCell(UITableViewCellStyle.Default, OVERVIEW_LINK_CELL);
cell.TextLabel.Text = "Full Schedule";
cell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
return cell;
}
}
示例6: GetCell
public override UITableViewCell GetCell (UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
{
var item = this.Data[indexPath.Row] as Stock;
if (item == null)
{
return base.GetCell (tableView, indexPath);
}
var cellProvider = tableView as ITableCellProvider;
if (cellProvider != null)
{
return cellProvider.GetCell (item);
}
var cell = tableView.DequeueReusableCell(StockCell.Key) as StockCell;
if (cell == null)
{
cell = StockCell.Create();
//var views = NSBundle.MainBundle.LoadNib("StockTableCell", cell, null);
//cell = Runtime.GetNSObject( views.ValueAt(0) ) as StockTableCell;
}
cell.Bind (item);
return cell;
}
示例7: GetCell
/// <summary>
/// Called by the TableView to get the actual UITableViewCell to render for the particular row
/// </summary>
public override UITableViewCell GetCell (UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
{
// request a recycled cell to save memory
UITableViewCell cell = tableView.DequeueReusableCell (cellIdentifier);
// UNCOMMENT one of these to use that style
var cellStyle = UITableViewCellStyle.Default;
// var cellStyle = UITableViewCellStyle.Subtitle;
// var cellStyle = UITableViewCellStyle.Value1;
// var cellStyle = UITableViewCellStyle.Value2;
// if there are no cells to reuse, create a new one
if (cell == null) {
cell = new UITableViewCell (cellStyle, cellIdentifier);
}
cell.TextLabel.Text = tableItems[indexPath.Row].Heading;
// Default style doesn't support Subtitle
if (cellStyle == UITableViewCellStyle.Subtitle
|| cellStyle == UITableViewCellStyle.Value1
|| cellStyle == UITableViewCellStyle.Value2) {
cell.DetailTextLabel.Text = tableItems[indexPath.Row].SubHeading;
}
// Value2 style doesn't support an image
if (cellStyle != UITableViewCellStyle.Value2)
cell.ImageView.Image = UIImage.FromFile ("Images/" +tableItems[indexPath.Row].ImageName);
return cell;
}
示例8: showWindow
partial void showWindow(MonoTouch.Foundation.NSObject sender)
{
hud = BindingLibrarySDK.MBProgressHUD.ShowHUDAddedTo(this.View, true);
hud.Show(true);
hud.LabelText = "加载中...";
hud.Hide(true, 1); // hide hud after 1s
}
示例9: GetCell
public MonoTouch.UIKit.UITableViewCell GetCell(MonoTouch.UIKit.UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
{
if (VM.CanLoadMore && !VM.IsBusy && (indexPath.Row == VM.Members.Count - 1))
VM.LoadMoreCommand.Execute (null);
return MainTableView.Source.GetCell (tableView, indexPath);
}
示例10: TitleForHeader
public string TitleForHeader (MonoTouch.UIKit.UITableView tableView, int section)
{
if (section == 1)
return "Right Drawer Width";
else
return base.TitleForHeader (tableView, section);
}
示例11: GetCell
public override MonoTouch.UIKit.UITableViewCell GetCell(MonoTouch.UIKit.UITableView tv)
{
var cell = base.GetCell (tv);
cell.TextLabel.Font = AppDelegate.Font;
cell.TextLabel.TextColor = UIColor.Black;
return cell;
}
示例12: GetCell
public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
{
ShopsTableCell cell = new ShopsTableCell(cellIdentifier);
try
{
cell = tableView.DequeueReusableCell(cellIdentifier) as ShopsTableCell;
if (cell == null)
cell = new ShopsTableCell(cellIdentifier);
if (!String.IsNullOrEmpty(tableItems[indexPath.Row].FirstPhotoUrl))
{
NSUrl nsUrl = new NSUrl(tableItems[indexPath.Row].FirstPhotoUrl);
NSData data = NSData.FromUrl(nsUrl);
if (data != null)
cell.UpdateCell(tableItems[indexPath.Row].Name, tableItems[indexPath.Row].Description, tableItems[indexPath.Row].Price.ToString("N2"), new UIImage(data));
else
cell.UpdateCell(tableItems[indexPath.Row].Name, tableItems[indexPath.Row].Description, tableItems[indexPath.Row].Price.ToString("N2"), new UIImage());
}
else
cell.UpdateCell(tableItems[indexPath.Row].Name, tableItems[indexPath.Row].Description, tableItems[indexPath.Row].Price.ToString("N2"), new UIImage());
OnGotCell();
CellOn = indexPath.Row;
}
catch (Exception exception)
{
ErrorHandler.Save(exception, MobileTypeEnum.iPhone);
}
return cell;
}
示例13: GetCell
/// <summary>
/// Called by the TableView to get the actual UITableViewCell to render for the particular section and row
/// </summary>
public override UITableViewCell GetCell (UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
{
//---- declare vars
UITableViewCell cell = tableView.DequeueReusableCell (this._customCellIdentifier);
CustomTableViewCell customCellController = null;
//---- if there are no cells to reuse, create a new one
if (cell == null)
{
customCellController = new CustomTableViewCell ();
// retreive the cell from our custom cell controller
cell = customCellController.Cell;
// give the cell a unique ID, so we can match it up to the controller
cell.Tag = Environment.TickCount;
// store our controller with the unique ID we gave our cell
this._cellControllers.Add (cell.Tag, customCellController);
}
else
{
// retreive our controller via it's unique ID
customCellController = this._cellControllers[cell.Tag];
}
//---- create a shortcut to our item
TagesgerichtBasicTableViewItem item = this._tableItems[indexPath.Section].Items[indexPath.Row];
//---- set our cell properties
customCellController.Heading = item.Name;
customCellController.SubHeading = item.SubHeading;
customCellController.Speisentext = item.Speisentext;
//---- return the custom cell
return cell;
}
示例14: RowSelected
public override void RowSelected (UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
{
var section = root.Sections [indexPath.Section];
var element = section.Elements [indexPath.Row];
element.Selected (container, tableView, indexPath);
}
示例15: GetCell
public override UITableViewCell GetCell (UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
{
UITableViewCell cell = tableView.DequeueReusableCell(kTableViewCellIdentifier, indexPath);
cell.TextLabel.Text = _visibleResults[indexPath.Row];
return cell;
}