本文整理汇总了C#中NSIndexPath类的典型用法代码示例。如果您正苦于以下问题:C# NSIndexPath类的具体用法?C# NSIndexPath怎么用?C# NSIndexPath使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NSIndexPath类属于命名空间,在下文中一共展示了NSIndexPath类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: RowSelected
public override void RowSelected (UITableView tableView, NSIndexPath indexPath)
{
new UIAlertView("Row Selected"
, indexedTableItems[keys[indexPath.Section]][indexPath.Row].Heading
, null, "OK", null).Show();
tableView.DeselectRow (indexPath, true);
}
开发者ID:FanWenjun,项目名称:TableView.iOS,代码行数:7,代码来源:ImageTableSource.cs
示例2: Selected
public override void Selected(DialogViewController dvc, UITableView tableView, NSIndexPath path)
{
Value = !Value;
InitializeCell(tableView);
base.Selected(dvc, tableView, path);
}
开发者ID:briandonahue,项目名称:MonoTouch.MVVM,代码行数:7,代码来源:CheckboxElement.cs
示例3: MoveItem
public override void MoveItem (UICollectionView collectionView, NSIndexPath sourceIndexPath, NSIndexPath destinationIndexPath)
{
// Reorder our list of items
var item = Numbers [(int)sourceIndexPath.Item];
Numbers.RemoveAt ((int)sourceIndexPath.Item);
Numbers.Insert ((int)destinationIndexPath.Item, item);
}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:7,代码来源:WaterfallCollectionSource.cs
示例4: Selected
public override void Selected(DialogViewController dvc, UITableView tableView, NSIndexPath indexPath)
{
var root = (RootElement)Parent.Parent;
root.RadioSelected = RadioIdx;
base.Selected(dvc, tableView, indexPath);
}
开发者ID:MvvmCross,项目名称:MvvmCross,代码行数:7,代码来源:RadioElement.cs
示例5: MoveRow
public override void MoveRow (UITableView tableView, NSIndexPath sourceIndexPath, NSIndexPath destinationIndexPath)
{
var section = Container.Root [sourceIndexPath.Section];
var source = section [sourceIndexPath.Row];
section.Remove (source);
section.Insert (destinationIndexPath.Row, source);
}
开发者ID:moljac,项目名称:MonoMobile.Dialog,代码行数:7,代码来源:DemoEditingAdvanced.cs
示例6: Selected
public override void Selected (DialogViewController dvc, UITableView tableView, NSIndexPath path)
{
if (IsReadonly) {
base.Selected (dvc, tableView, path);
return;
}
var controller = new UIViewController ();
UITextView disclaimerView = new UITextView (controller.View.Frame);
// disclaimerView.BackgroundColor = UIColor.FromWhiteAlpha (0, 0);
// disclaimerView.TextColor = UIColor.White;
// disclaimerView.TextAlignment = UITextAlignment.Left;
if (!string.IsNullOrWhiteSpace (Value))
disclaimerView.Text = Value;
else
disclaimerView.Text = string.Empty;
disclaimerView.Font = UIFont.SystemFontOfSize (16f);
disclaimerView.Editable = true;
controller.View.AddSubview (disclaimerView);
controller.NavigationItem.Title = Caption;
controller.NavigationItem.RightBarButtonItem = new UIBarButtonItem (string.IsNullOrEmpty (_saveLabel) ? "Save" : _saveLabel, UIBarButtonItemStyle.Done, (object sender, EventArgs e) => {
if (OnSave != null)
OnSave (this, EventArgs.Empty);
controller.NavigationController.PopViewControllerAnimated (true);
Value = disclaimerView.Text;
});
dvc.ActivateController (controller);
}
开发者ID:ClusterReplyBUS,项目名称:MonoTouch.Dialog,代码行数:32,代码来源:SelectableMultilineEntryElement.cs
示例7: GetCell
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath)
{
var cell = tableView.DequeueReusableCell("ArterTableCell");
if(cell == null)
cell = new UIJaktTableViewCell(UITableViewCellStyle.Default, "ArterTableCell");
var groupId = JaktLoggApp.instance.ArtGroupList[indexPath.Section].ID;
var artsInSection = JaktLoggApp.instance.ArtList.Where(a => a.GroupId == groupId);
var c = artsInSection.Count();
//legg til art - knapp
if(_controller.TableView.Editing && groupId == 100 && indexPath.Row == c){
cell.TextLabel.Text = Utils.Translate("specie.new");
//cell.Accessory = UITableViewCellAccessory.None;
cell.ImageView.Image = null;
}
else
{
var art = artsInSection.ElementAt(indexPath.Row);
var label = art.Navn;
var icon = JaktLoggApp.instance.SelectedArtIds.Contains(art.ID) ? "icon_checked.png" : "icon_unchecked.png";
var file = "Images/Icons/"+icon;
cell.ImageView.Image = new UIImage(file);
cell.ImageView.Layer.MasksToBounds = true;
cell.ImageView.Layer.CornerRadius = 5.0f;
cell.TextLabel.Text = label;
cell.TextLabel.TextAlignment = UITextAlignment.Left;
if(!EditMode)
cell.Accessory = UITableViewCellAccessory.DetailDisclosureButton;
}
return cell;
}
开发者ID:darkwood,项目名称:Jaktloggen,代码行数:33,代码来源:ArterTableSource.cs
示例8: GetItemAt
protected override object GetItemAt(NSIndexPath indexPath)
{
if (ItemsSource == null)
return null;
return ItemsSource.ElementAt(indexPath.Row);
}
开发者ID:JoanMiro,项目名称:MvxMod,代码行数:7,代码来源:MvxBindableTableViewSource.cs
示例9: GetCell
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath)
{
var cell = TableView.DequeueReusableCell (new NSString ("cell"), indexPath);
CKRecord record = records[indexPath.Row];
cell.TextLabel.Text = (NSString)record["name"];
return cell;
}
开发者ID:RangoJT,项目名称:monotouch-samples,代码行数:7,代码来源:CKReferenceViewController.cs
示例10: GetCell
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
{
var cell = tableView.DequeueReusableCell(cellIdentifier) as MonkeyCell ?? new MonkeyCell(cellIdentifier);
//cell.Image = new UIImage(monkeys[indexPath.Row].Image);
cell.Name = monkeys[indexPath.Row].Name;
return cell;
}
开发者ID:kamstrup,项目名称:MonkeySearch-iOS-9,代码行数:7,代码来源:MonkeyTableViewController.cs
示例11: GetCell
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
{
var cell = tableView.DequeueReusableCell(cellIdentifier) as TransferViewCell;
cell.SetData(_mainViewModel.Shl[indexPath.Row]);
return cell;
}
开发者ID:dhindrik,项目名称:TechDays2015,代码行数:7,代码来源:ShlViewController.cs
示例12: GetHeightForRow
public override nfloat GetHeightForRow(UITableView tableView, NSIndexPath indexPath)
{
// In here you could customize how you want to get the height for row. Then
// just return it.
return 60;
}
开发者ID:tienbui123,项目名称:Mobile-VS2,代码行数:7,代码来源:LichHocHKSource.cs
示例13: GetHeightForRow
public override nfloat GetHeightForRow(UITableView tableView, NSIndexPath indexPath)
{
switch (indexPath.Section)
{
case 0:
{
switch (indexPath.Row)
{
case 1: // hemisphere picker
if (_editingHemisphere)
{
return 119;
}
else
{
return 0;
}
case 3: // speed picker
if (_editingSpeed)
{
return 119;
}
else
{
return 0;
}
}
}
break;
}
return base.GetHeightForRow(tableView, indexPath);
}
开发者ID:milindur,项目名称:MdkControlApp,代码行数:33,代码来源:ModeAstroViewController.cs
示例14: GetCell
/// <summary>
/// Gets the actual UITableViewCell to render for the particular section and row
/// </summary>
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath)
{
//---- declare vars
UITableViewCell cell = tableView.DequeueReusableCell (cellIdentifier);
TableItem item = indexedTableItems[keys[indexPath.Section]][indexPath.Row];
if (cell == null)
{
// use a Subtitle cell style here
cell = new UITableViewCell (UITableViewCellStyle.Subtitle, cellIdentifier);
}
//---- set the item text, subtitle and image/icon
cell.TextLabel.Text = item.Heading;
cell.DetailTextLabel.Text = item.Album;
cell.ImageView.Image = UIImage.FromFile("Images/" + item.ImageName);
// if the item is marked as a favorite, use the CheckMark cell accessory
// otherwise (i.e. when false) use the disclosure cell accessory
if (item.Singing) {
cell.Accessory = UITableViewCellAccessory.Checkmark;
} else {
cell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
}
return cell;
}
开发者ID:FanWenjun,项目名称:TableView.iOS,代码行数:29,代码来源:ImageTableSource.cs
示例15: RowSelected
public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
{
tableView.DeselectRow(indexPath, true);
if (RowSelectedAction != null) {
RowSelectedAction(tableView, indexPath);
}
}
开发者ID:Securecom,项目名称:Securecom-Messaging-iOS,代码行数:7,代码来源:CustomCellTableSource.cs
示例16: 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, NSIndexPath indexPath)
{
// declare vars
UITableViewCell cell = tableView.DequeueReusableCell (cellIdentifier);
//string item = tableItems [indexPath.Row]; //.Items[indexPath.Row];
// if there are no cells to reuse, create a new one
if (cell == null)
cell = new UITableViewCell (UITableViewCellStyle.Subtitle, cellIdentifier);
// set the item text
cell.TextLabel.Text = tableItems [indexPath.Row];//.Items[indexPath.Row].Heading;
// if it's a cell style that supports a subheading, set it
// if(item.CellStyle == UITableViewCellStyle.Subtitle
// || item.CellStyle == UITableViewCellStyle.Value1
// || item.CellStyle == UITableViewCellStyle.Value2)
// { cell.DetailTextLabel.Text = item.SubHeading; }
// if the item has a valid image, and it's not the contact style (doesn't support images)
// if(!string.IsNullOrEmpty(item.ImageName) && item.CellStyle != UITableViewCellStyle.Value2)
// {
// if(File.Exists(item.ImageName))
// cell.ImageView.Image = UIImage.FromBundle(item.ImageName);
// }
// set the accessory
cell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
return cell;
}
开发者ID:RickySan65,项目名称:xamarin-forms-samples,代码行数:34,代码来源:NativeListViewSource.cs
示例17: GetTestForIndexPath
Test GetTestForIndexPath (NSIndexPath indexPath)
{
if (indexPath.Section > 0 || indexPath.Row >= Tests.Count)
return null;
return Tests [indexPath.Row];
}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:7,代码来源:BasicTestViewController.cs
示例18: GetCell
public override UICollectionViewCell GetCell(UICollectionView collectionView, NSIndexPath indexPath)
{
var cell = (PictureBigCollectionCell)collectionView.DequeueReusableCell (PictureBigCollectionCell.CellId, indexPath);
cell.resetScale ();
AppDelegate.MakeImageFromURL (cell.Image, Items.Images [indexPath.Row]);
return cell;
}
开发者ID:jgrozdanov,项目名称:mono-sport,代码行数:7,代码来源:PictureBigCollectionController.cs
示例19: EditingStyleForRow
public override UITableViewCellEditingStyle EditingStyleForRow (UITableView tableView, NSIndexPath indexPath)
{
var artsInSection = JaktLoggApp.instance.ArtList.Where(a => a.GroupId == 100).Count();
if(indexPath.Section == 0 && indexPath.Row == artsInSection)
return UITableViewCellEditingStyle.Insert;
return UITableViewCellEditingStyle.Delete;
}
开发者ID:darkwood,项目名称:Jaktloggen,代码行数:7,代码来源:ArterTableSource.cs
示例20: SetDetailItem
public async Task SetDetailItem (MotionActivityQuery newDetailItem)
{
if (detailItem != newDetailItem)
detailItem = newDetailItem;
configureView ();
currentSteps = 0;
currentActivity = "n/a";
activityDataManager.StopStepUpdates ();
activityDataManager.StopMotionUpdates ();
await activityDataManager.QueryAsync (detailItem);
TableView.ReloadData ();
if (detailItem.IsToday) {
activityDataManager.StartStepUpdates ((stepCount) => {
currentSteps = stepCount;
var indexPaths = new NSIndexPath [] { NSIndexPath.FromRowSection (0, 1) };
TableView.ReloadRows (indexPaths, UITableViewRowAnimation.None);
});
activityDataManager.StartMotionUpdates ((type) => {
var indexPaths = new NSIndexPath [] { NSIndexPath.FromRowSection (4, 0) };
TableView.ReloadRows (indexPaths, UITableViewRowAnimation.None);
});
}
}
开发者ID:RangoJT,项目名称:monotouch-samples,代码行数:27,代码来源:AAPLDetailViewController.cs
注:本文中的NSIndexPath类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论