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


C# UITableView.ReloadSections方法代码示例

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


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

示例1: GetViewForHeader

		public override UIView GetViewForHeader (UITableView tableView, nint section)
		{

			var btn = new UIButton (new CGRect (0, 0, tableView.Frame.Width, CollapsibleListViewCell.HEIGHT));
			btn.TitleEdgeInsets = new UIEdgeInsets (btn.TitleEdgeInsets.Top, CollapsibleListViewCell.ParentItemLeftPadding, btn.TitleEdgeInsets.Bottom, btn.TitleEdgeInsets.Right);
			btn.AutoresizingMask = UIViewAutoresizing.All;


			//set section header right side image
			if (!string.IsNullOrEmpty (Settings [(int)section].SelectedStateIcon) && !string.IsNullOrEmpty (Settings [(int)section].DeselectedStateIcon)) {
				var btnImg = btn.ViewWithTag ((int)section);
				if (btnImg != null) {
					btnImg.RemoveFromSuperview ();
				}
				var img = !Settings [(int)section].IsSelected ? new UIImageView (UIImage.FromBundle (Settings [(int)section].DeselectedStateIcon)) : new UIImageView (UIImage.FromBundle (Settings [(int)section].SelectedStateIcon));
				img.Tag = (int)section;
				img.Frame = new CGRect (
					btn.Frame.Width - CollapsibleListViewCell.HEIGHT - 20, 
					0,
					CollapsibleListViewCell.HEIGHT,
					CollapsibleListViewCell.HEIGHT
				);
				img.ContentMode = UIViewContentMode.Center;
				img.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin;
				//img.BackgroundColor = UIColor.Yellow;
				btn.AddSubview (img);
			}

			//ADD SEPERATOR LINE AT BOTTOM
			var seperatorLine = new UIView (new CGRect (0, CollapsibleListViewCell.HEIGHT - 1, tableView.Frame.Width, 1));
			seperatorLine.BackgroundColor = UIColor.LightGray;
			seperatorLine.Alpha = 0.3f;
			seperatorLine.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;
			btn.AddSubview (seperatorLine);

			btn.SetTitle (Settings [(int)section].Title, UIControlState.Normal);
			btn.Font = UIFont.BoldSystemFontOfSize (CollapsibleListViewCell.FontSize);
			btn.BackgroundColor = UIColor.Clear;
			btn.HorizontalAlignment = UIControlContentHorizontalAlignment.Left;
			btn.SetTitleColor (UIColor.DarkGray, UIControlState.Normal);
			btn.TouchUpInside += (sender, e) => {
				//put in your code to toggle your boolean value here
				if (Settings [(int)section].OnClickListener != null) {
					Settings [(int)section].OnClickListener.Invoke (Settings [(int)section]);
				} 

				Settings [(int)section].IsSelected = !Settings [(int)section].IsSelected;

				///reload this section
				tableView.ReloadSections (NSIndexSet.FromIndex (section), UITableViewRowAnimation.Fade);
			};
			return btn;
		}
开发者ID:MGohil,项目名称:Xamarin-iOS-CollapsibleListView,代码行数:53,代码来源:CollapsibleListView.cs

示例2: RowSelected

		public override void RowSelected (UITableView tableView, NSIndexPath indexPath)
		{
			if (OnRowSelected != null) {
				OnRowSelected (this, new RowSelectedEventArgs (tableView, indexPath));
			}

			//Code to change the status of the rtight icon in the row items		
			var item = Settings [indexPath.Section].ChildItems [indexPath.Row];
			if (item != null) {

				if (item.OnClickListener != null) {
					item.OnClickListener.Invoke (item);
				} else {
					item.IsSelected = !item.IsSelected;
				}
				tableView.ReloadSections (NSIndexSet.FromIndex (indexPath.Section), UITableViewRowAnimation.Fade);
			}
			tableView.DeselectRow (indexPath, true);
		}
开发者ID:MGohil,项目名称:Xamarin-iOS-CollapsibleListView,代码行数:19,代码来源:CollapsibleListView.cs

示例3: RowSelected

		public override void RowSelected (UITableView tableView, NSIndexPath indexPath)
		{
			switch (SectionForIndex (indexPath.Section)) {
			case TriggerTableViewSection.Location:
				PerformSegue (selectLocationSegue, this);
				break;

			case TriggerTableViewSection.Region:
				LocationTriggerCreator.TargetRegionStateIndex = indexPath.Row;
				var reloadIndexSet = NSIndexSet.FromIndex (indexPath.Section);
				tableView.ReloadSections (reloadIndexSet, UITableViewRowAnimation.Automatic);
				break;

			default:
				base.RowSelected (tableView, indexPath);
				break;
			}
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:18,代码来源:LocationTriggerViewController.cs

示例4: RowSelected

		public override void RowSelected (UITableView tableView, NSIndexPath indexPath)
		{
			base.RowSelected (tableView, indexPath);

			var cell = tableView.CellAt (indexPath);
			if (cell.SelectionStyle == UITableViewCellSelectionStyle.None)
				return;

			tableView.DeselectRow (indexPath, true);

			switch ((TimeConditionTableViewSection)indexPath.Section) {
			case TimeConditionTableViewSection.TimeOrSun:
				timeType = (TimeConditionType)indexPath.Row;
				ReloadDynamicSections ();
				return;
			case TimeConditionTableViewSection.BeforeOrAfter:
				order = (TimeConditionOrder)indexPath.Row;
				tableView.ReloadSections (NSIndexSet.FromIndex (indexPath.Section), UITableViewRowAnimation.Automatic);
				break;
			case TimeConditionTableViewSection.Value:
				if (timeType == TimeConditionType.Sun)
					sunState = (TimeConditionSunState)indexPath.Row;
				tableView.ReloadSections (NSIndexSet.FromIndex (indexPath.Section), UITableViewRowAnimation.Automatic);
				break;
			default:
				throw new InvalidOperationException ("Unexpected `TimeConditionTableViewSection` value.");
			}
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:28,代码来源:TimeConditionViewController.cs

示例5: RowSelected

		public override void RowSelected (UITableView tableView, NSIndexPath indexPath)
		{
			tableView.DeselectRow (indexPath, true);

			switch ((AddAccessoryTableViewSection)indexPath.Section) {
			case AddAccessoryTableViewSection.Rooms:
				if (!Home.IsAdmin ())
					return;
				selectedRoom = Home.GetAllRooms () [indexPath.Row];

				var sections = NSIndexSet.FromIndex ((nint)(int)AddAccessoryTableViewSection.Rooms);
				tableView.ReloadSections (sections, UITableViewRowAnimation.Automatic);
				break;
			case AddAccessoryTableViewSection.Identify:
				IdentifyAccessory ();
				break;
			case AddAccessoryTableViewSection.Name:
				break;
			default:
				throw new InvalidOperationException ("Unexpected `AddAccessoryTableViewSection` value.");
			}
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:22,代码来源:ModifyAccessoryViewController.cs

示例6: toggleTimePickerCell

            /// <summary>
            /// Toggles the time picker cell on or off.
            /// If any other picker cells are on, turns them off.
            /// </summary>
            /// <param name="tableView">The UITableView the cell is associated with.</param>
            private void toggleTimePickerCell(UITableView tableView)
            {
                // Toggle the timePicker cell
                this.timePicker.Hidden = this.timePickerIsShowing;
                this.timePickerIsShowing = !this.timePickerIsShowing;

                // Close any other picker cells
                if (this.dayPickerIsShowing)
                    toggleDayPickerCell (tableView);

                // Reload the section
                NSIndexSet sections = new NSIndexSet (PICKER_SECTION);
                tableView.ReloadSections (sections, UITableViewRowAnimation.Fade);
            }
开发者ID:MobiusGen,项目名称:Animal-Care-iOS,代码行数:19,代码来源:SettingsController.cs

示例7: SelectRecurrenceComponent

		// Handles selection of a recurrence cell.
		// If the newly selected recurrence component is the previously selected
		// recurrence component, reset the current selected component to `-1` and deselect that row.
		void SelectRecurrenceComponent (UITableView tableView, NSIndexPath indexPath)
		{
			bool isPreviouslySelected = indexPath.Row == TimerTriggerCreator.SelectedRecurrenceIndex;
			TimerTriggerCreator.SelectedRecurrenceIndex = isPreviouslySelected ? -1 : indexPath.Row;
			tableView.ReloadSections (NSIndexSet.FromIndex (indexPath.Section), UITableViewRowAnimation.Automatic);
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:9,代码来源:TimerTriggerViewController.cs


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