• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# MonoTouch类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MonoTouch的典型用法代码示例。如果您正苦于以下问题:C# MonoTouch类的具体用法?C# MonoTouch怎么用?C# MonoTouch使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MonoTouch类属于命名空间,在下文中一共展示了MonoTouch类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
			}
开发者ID:mikebluestein,项目名称:MonoTouch.Dialog,代码行数:7,代码来源:DialogViewController.cs


示例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;
 }
开发者ID:BoogieMAN2K,项目名称:monotouch-samples,代码行数:10,代码来源:CheckmarkGestureRecognizer.cs


示例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);
        }
开发者ID:asednev,项目名称:MvvmCross.AlexeysExtensions,代码行数:7,代码来源:SampleStringElement.cs


示例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;
        }
开发者ID:rajeshwarn,项目名称:GhostPractice-iPadRepo,代码行数:58,代码来源:TableSource.cs


示例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;
                }
            }
开发者ID:jorik041,项目名称:NycCodeCamp6,代码行数:30,代码来源:CampOverviewViewController.cs


示例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;
        }
开发者ID:paul33868,项目名称:SimplyMobile,代码行数:29,代码来源:StockDataAdapter.cs


示例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;
		}
开发者ID:kiwchang,项目名称:Storyboard.Tabbar.EmbeddedTableview,代码行数:34,代码来源:TableSource.cs


示例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
        }
开发者ID:sunleepy,项目名称:monotouch_binding,代码行数:7,代码来源:BindingLibrarySampleViewController.cs


示例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);
        }
开发者ID:rferolino,项目名称:MeetupManager,代码行数:7,代码来源:EventView.designer.cs


示例10: TitleForHeader

		public string TitleForHeader (MonoTouch.UIKit.UITableView tableView, int section)
		{
			if (section == 1)
				return "Right Drawer Width";
			else
				return base.TitleForHeader (tableView, section);
		}
开发者ID:adlair,项目名称:MMDrawerController,代码行数:7,代码来源:MMExampleRightSideDrawerViewController.cs


示例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;
 }
开发者ID:AlexanderMazaletskiy,项目名称:DietCalculatorUniversal,代码行数:7,代码来源:DietRadioElement.cs


示例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;
        }
开发者ID:mukhtiarlander,项目名称:git_demo_torit,代码行数:31,代码来源:ShopsTableView.cs


示例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;
		}
开发者ID:bpug,项目名称:LbkIos,代码行数:37,代码来源:TagesgerichtCustomTableViewSource.cs


示例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);
			}
开发者ID:mikebluestein,项目名称:MonoTouch.Dialog,代码行数:7,代码来源:DialogViewController.cs


示例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;
		}
开发者ID:Luceres,项目名称:monotouch-samples,代码行数:7,代码来源:SearchControllerBaseViewController.cs


示例16: GetCell

 public override MonoTouch.UIKit.UITableViewCell GetCell(DialogViewController dvc, MonoTouch.UIKit.UITableView tv)
 {
     var cell =  base.GetCell (dvc, tv);
     cell.ImageView.Image = ImageStore.GetLocalProfilePicture(Friend.ID);
     cell.DetailTextLabel.Text = "Shot Count: " + Friend.HitCount;
     return cell;
 }
开发者ID:Clancey,项目名称:Facetroids,代码行数:7,代码来源:FriendsViewController.cs


示例17: plusButtonClick

partial         void plusButtonClick(MonoTouch.Foundation.NSObject sender)
        {
            //NSError error;
            mapView.zoomIn();
            Console.WriteLine("xxx");
            Console.WriteLine(mapView.zoomLevel);
        }
开发者ID:skorinko,项目名称:monotouch-yandexmapkit,代码行数:7,代码来源:YandexMonoTestViewController.cs


示例18: 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);
            //			// if there are no cells to reuse, create a new one
            //			if (cell == null)
            //				cell = new UITableViewCell (UITableViewCellStyle.Default, cellIdentifier);
            //
            DCTCell cell = tableView.DequeueReusableCell (cellIdentifier) as DCTCell;

            if (cell == null)
                cell = new DCTCell ((MonoTouch.Foundation.NSString)cellIdentifier);

            //cell.Editing = true; // Make the cell deletable
            //cell.ShouldIndentWhileEditing = true;
            //cell.ShowingDeleteConfirmation = true;
            cell.TextLabel.Text = indexedTableItems[keys[indexPath.Section]][indexPath.Row];
            //cell.

            //			BlackLeatherTheme.Apply(cell);
            cell.Layer.CornerRadius = 7.0f;
            cell.Layer.MasksToBounds = true;
            cell.Layer.BorderWidth = 2.0f;
            cell.Layer.BorderColor = UIColor.FromRGBA (34f,139f,34f, 0.9f).CGColor;
            cell.TintColor = UIColor.Orange;
            cell.BackgroundColor = UIColor.FromRGBA (34f,139f,34f, 0.5f);
            return cell;
        }
开发者ID:Skalar,项目名称:Indexer,代码行数:31,代码来源:TableSourceItemsIndexed.cs


示例19: CommitEditingStyle

        public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, MonoTouch.Foundation.NSIndexPath indexPath)
        {
            switch (editingStyle) {
            case UITableViewCellEditingStyle.Delete:
                // remove the item from the underlying data source
                this.RaiseTaskDeleted(indexPath.Row);
                tableItems.RemoveAt(indexPath.Row);
                // delete the row from the table
                tableView.DeleteRows (new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);

                break;

            case UITableViewCellEditingStyle.Insert:
                //---- create a new item and add it to our underlying data

                Item obj = new Item();
                obj.Name = "Inserted";
                obj.Description ="Placeholder";
            //				obj.imageFileName = "second.png";

                tableItems.Insert (indexPath.Row, obj);

                //---- insert a new row in the table
                tableView.InsertRows (new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);
                break;

            case UITableViewCellEditingStyle.None:
                Console.WriteLine ("CommitEditingStyle:None called");
                break;
            }
        }
开发者ID:KuroiAme,项目名称:Indexer,代码行数:31,代码来源:TableSourceItems.cs


示例20: scanPressed

partial         void scanPressed(MonoTouch.UIKit.UIBarButtonItem sender)
        {
            if (overlayController.ParentPicker == null)
            {
                BarcodePickerController picker = new BarcodePickerController ();

                // setup picker
                picker.Overlay = overlayController;
                picker.Delegate = new BarcodePickerDelegate (this);

                // Initialize with portrait mode as default
                picker.Orientation = UIImageOrientation.Up;

                // The active scanning region size is set in OverlayController.m
            }

            // Update barcode on/off settings
            overlayController.ParentPicker.ScanUPCE = enableUPCESwitch.On;
            overlayController.ParentPicker.ScanEAN8 = enableEAN8Switch.On;
            overlayController.ParentPicker.ScanEAN13 = enableEAN13Switch.On;
            overlayController.ParentPicker.ScanQRCODE = enableQRCodeSwitch.On;
            overlayController.ParentPicker.ScanCODE128 = enableCode128Switch.On;
            overlayController.ParentPicker.ScanCODE39 = enableCode39Switch.On;
            //overlayController.parentPicker.ScanDataMatrix = enableDataMatrixSwitch.On;
            overlayController.ParentPicker.ScanITF = enableITFSwitch.On;

            // Data matrix decoding does not work very well so it is disabled for now
            overlayController.ParentPicker.ScanDATAMATRIX = false;

            // hide the status bar
            UIApplication.SharedApplication.StatusBarHidden = true;

            // Show the scanner overlay
            this.PresentModalViewController (overlayController.ParentPicker, true);
        }
开发者ID:nledevil,项目名称:monotouch-bindings,代码行数:35,代码来源:RLSampleViewController.cs



注:本文中的MonoTouch类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UIKit.UIButton类代码示例发布时间:2022-05-24
下一篇:
C# MonoTextEditor类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap