当前位置: 首页>>代码示例>>C#>>正文


C# UITableView.NumberOfRowsInSection方法代码示例

本文整理汇总了C#中UITableView.NumberOfRowsInSection方法的典型用法代码示例。如果您正苦于以下问题:C# UITableView.NumberOfRowsInSection方法的具体用法?C# UITableView.NumberOfRowsInSection怎么用?C# UITableView.NumberOfRowsInSection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UITableView的用法示例。


在下文中一共展示了UITableView.NumberOfRowsInSection方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CustomizeMoveTarget

 public override NSIndexPath CustomizeMoveTarget(UITableView tableView, NSIndexPath sourceIndexPath, NSIndexPath proposedIndexPath)
 {
     var numRows = tableView.NumberOfRowsInSection (0) - 1; // less the (add new) one
     if (proposedIndexPath.Row >= numRows)
         return NSIndexPath.FromRowSection(numRows - 1, 0);
     else
         return proposedIndexPath;
 }
开发者ID:KuroiAme,项目名称:Indexer,代码行数:8,代码来源:TableSourceItems.cs

示例2: CalculateSelectedRow

		private int CalculateSelectedRow (NSIndexPath indexPath, UITableView tableView)
		{
			int totalCountOfRows = 0;
			int selectedSectionNumber = indexPath.Section;
			
			for (int currentSectionNumber = 0; currentSectionNumber < selectedSectionNumber; ++ currentSectionNumber) {
				totalCountOfRows += tableView.NumberOfRowsInSection (currentSectionNumber);
			}
			
			int selectedRow = totalCountOfRows + indexPath.Row;
			
			return selectedRow;
		}
开发者ID:RobGibbens,项目名称:ArtekSoftware.Codemash,代码行数:13,代码来源:ScheduleDialogViewController.cs

示例3: CommitEditingStyle

 public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
 {
     //base.CommitEditingStyle(tableView, editingStyle, indexPath);
     if (editingStyle == UITableViewCellEditingStyle.Delete) {
         UITableViewCell cell = tableView.CellAt(indexPath);
         if (cell != null)
             cell.BackgroundColor = UIColor.White;
         BNRItem itemToRemove = BNRItemStore.allItems[indexPath.Row];
         BNRItemStore.RemoveItem(itemToRemove);
         NSIndexPath[] indexPaths = new NSIndexPath[] {indexPath};
         TableView.DeleteRows(indexPaths, UITableViewRowAnimation.Automatic);
         Console.WriteLine("allItems: {0}, tableViewRows: {1}", BNRItemStore.allItems.Count, tableView.NumberOfRowsInSection(0));
     }
 }
开发者ID:yingfangdu,项目名称:BNR,代码行数:14,代码来源:ItemsViewController.cs

示例4: CanEditRow

			public override bool CanEditRow (UITableView tableView, NSIndexPath indexPath)
			{
				/*
				var cell = base.GetCell(tableView, indexPath);
				var reuse = cell.ReuseIdentifier;
				
				if (reuse == "LoadMoreElement")
					return true;
				*/	
				
				int rows = tableView.NumberOfRowsInSection(0);
				if (rows - 1 == indexPath.Row)
					return false;
					
				// Trivial implementation: we let all rows be editable, regardless of section or row
				return true;
			}
开发者ID:21Off,项目名称:21Off,代码行数:17,代码来源:AdvancedEditingDialog.cs

示例5: DidFinishTableEditing

 public void DidFinishTableEditing(UITableView tableView)
 {
     tableView.BeginUpdates ();
     // remove our 'ADD NEW' row from the underlying data
     tableItems.RemoveAt (tableView.NumberOfRowsInSection (0) - 1); // zero based :)
     // remove the row from the table display
     tableView.DeleteRows (new NSIndexPath[] { NSIndexPath.FromRowSection (tableView.NumberOfRowsInSection (0) - 1, 0) }, UITableViewRowAnimation.Fade);
     tableView.EndUpdates (); // applies the changes
 }
开发者ID:KuroiAme,项目名称:Indexer,代码行数:9,代码来源:TableSourceItems.cs

示例6: CanMoveRow

 public override bool CanMoveRow(UITableView tableView, NSIndexPath indexPath)
 {
     return indexPath.Row < tableView.NumberOfRowsInSection (0) - 1;
 }
开发者ID:KuroiAme,项目名称:Indexer,代码行数:4,代码来源:TableSourceItems.cs

示例7: WillBeginTableEditing

 public void WillBeginTableEditing(UITableView tableView)
 {
     tableView.BeginUpdates ();
     // insert the 'ADD NEW' row at the end of table display
     tableView.InsertRows (new NSIndexPath[] {
         NSIndexPath.FromRowSection (tableView.NumberOfRowsInSection (0), 0)
     }, UITableViewRowAnimation.Fade);
     // create a new item and add it to our underlying data (it is not intended to be permanent)
     Item o = new Item ();
     o.Name = "(add new)";
     //			o.imageFileNames = new List<string> ();
     o.ImageFileName = "first.png";
     tableItems.Add (o);
     tableView.EndUpdates (); // applies the changes
 }
开发者ID:KuroiAme,项目名称:Indexer,代码行数:15,代码来源:TableSourceItems.cs

示例8: EditingStyleForRow

 public override UITableViewCellEditingStyle EditingStyleForRow(UITableView tableView, NSIndexPath indexPath)
 {
     if (tableView.Editing) {
         if (indexPath.Row == tableView.NumberOfRowsInSection (0) - 1)
             return UITableViewCellEditingStyle.Insert;
         else
             return UITableViewCellEditingStyle.Delete;
     } else // not in editing mode, enable swipe-to-delete for all rows
         return UITableViewCellEditingStyle.Delete;
 }
开发者ID:KuroiAme,项目名称:Indexer,代码行数:10,代码来源:TableSourceItems.cs

示例9: WillBeginTableEditing

		/// <summary>
		/// Called manually when the table goes into edit mode
		/// </summary>
		public void WillBeginTableEditing (UITableView tableView)
		{
			//---- start animations
			tableView.BeginUpdates ();
			
			//---- insert a new row in the table
			tableView.InsertRows (new NSIndexPath[] { 
					NSIndexPath.FromRowSection (tableView.NumberOfRowsInSection (0), 0) 
				}, UITableViewRowAnimation.Fade);
			//---- create a new item and add it to our underlying data
			tableItems.Add (new TableItem ("(add new)"));
			
			//---- end animations
			tableView.EndUpdates ();
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:18,代码来源:TableSource.cs

示例10: DeleteComment

		public static void DeleteComment(Post post, Comment comment, UITableView tableView, NSIndexPath indexPath, List<Comment> underlyingDataSource)
		{
			post.liked = true;

			CATransaction.Begin();

			tableView.BeginUpdates();

			CATransaction.CompletionBlock += async delegate
			{
				try
				{
					bool result = await TenServices.DeleteComment(comment, post);
					if (!result)
					{

						underlyingDataSource.Insert(indexPath.Row, comment);
						tableView.ReloadData();
					}
					return;
				}
				catch (RESTError)
				{
					Console.WriteLine("Error service helper");
				}
				return;
			};

			if (tableView.NumberOfRowsInSection(indexPath.Section) == 1)
			{
				tableView.DeleteSections(NSIndexSet.FromIndex(indexPath.Section), UITableViewRowAnimation.Left);
			}
			else {
				tableView.DeleteRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Left);
			}

			underlyingDataSource.Remove(comment);

			tableView.EndUpdates();

			CATransaction.Commit();
		}
开发者ID:natevarghese,项目名称:XamarinTen,代码行数:42,代码来源:TenServiceHelper.cs

示例11: DidFinishTableEditingWithoutSave

		public void DidFinishTableEditingWithoutSave (UITableView tableView)
		{
			tableView.BeginUpdates ();

			_tableItems.RemoveAt ((int)tableView.NumberOfRowsInSection (0) - 2);
			tableView.DeleteRows (new NSIndexPath[] { NSIndexPath.FromRowSection (tableView.NumberOfRowsInSection (0) - 2, 0) }, UITableViewRowAnimation.Fade);

			tableView.EndUpdates ();
		}
开发者ID:dtimyr,项目名称:xamarin,代码行数:9,代码来源:VTSTableSource.cs

示例12: WillBeginTableEditing

		public void WillBeginTableEditing (UITableView tableView)
		{
			tableView.BeginUpdates ();

			tableView.InsertRows (new NSIndexPath[] { 
				NSIndexPath.FromRowSection (tableView.NumberOfRowsInSection (0), 0) 
			}, UITableViewRowAnimation.Fade);
			_tableItems.Add (null);

			tableView.EndUpdates ();
		}
开发者ID:dtimyr,项目名称:xamarin,代码行数:11,代码来源:VTSTableSource.cs

示例13: EditingStyleForRow

		public override UITableViewCellEditingStyle EditingStyleForRow (UITableView tableView, NSIndexPath indexPath)
		{
			if (tableView.Editing) {
				if (indexPath.Row == tableView.NumberOfRowsInSection (0) - 1) {
					return UITableViewCellEditingStyle.Insert;
				} else {
					return UITableViewCellEditingStyle.Delete;
				}
			} else {
				return UITableViewCellEditingStyle.Delete;
			}
		}
开发者ID:dtimyr,项目名称:xamarin,代码行数:12,代码来源:VTSTableSource.cs

示例14: DidFinishTableEditing

		/// <summary>
		/// Called manually when the table leaves edit mode
		/// </summary>
		public void DidFinishTableEditing (UITableView tableView)
		{
			//---- start animations
			tableView.BeginUpdates ();
			//---- remove our row from the underlying data
			tableItems.RemoveAt ((int)tableView.NumberOfRowsInSection (0) - 1); // zero based :)
			//---- remove the row from the table
			tableView.DeleteRows (new NSIndexPath[] { NSIndexPath.FromRowSection (tableView.NumberOfRowsInSection (0) - 1, 0) }, UITableViewRowAnimation.Fade);
			//---- finish animations
			tableView.EndUpdates ();
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:14,代码来源:TableSource.cs

示例15: WillBeginTableEditing

		/// <summary>
		/// Called manually when the table goes into edit mode
		/// </summary>
		public void WillBeginTableEditing(UITableView tableView)
		{
			//---- start animations
			tableView.BeginUpdates();

			//---- insert a new row in the table
			tableView.InsertRows(new NSIndexPath[] { NSIndexPath.FromRowSection(tableView.NumberOfRowsInSection(0), 0) }, UITableViewRowAnimation.Fade);
		
			//---- end animations
			tableView.EndUpdates();
		}
开发者ID:Securecom,项目名称:Securecom-Messaging-iOS,代码行数:14,代码来源:CustomCellTableSource.cs


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