[WorkingWithTables]Adding Sample for docs purposes
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<SampleMetadata>
|
||||
<ID>ECCEE408-0713-44A6-99A5-72BAC80002E8</ID>
|
||||
<IsFullApplication>false</IsFullApplication>
|
||||
<Level>Intermediate</Level>
|
||||
<Tags>User Interface</Tags>
|
||||
<Gallery>true</Gallery>
|
||||
<Brief>This collection of samples shows how to use a table in Xamarin.iOS</Brief>
|
||||
</SampleMetadata>
|
|
@ -0,0 +1,38 @@
|
|||
using System;
|
||||
using UIKit;
|
||||
using Foundation;
|
||||
|
||||
namespace BasicTable {
|
||||
public class Application {
|
||||
public static void Main (string[] args)
|
||||
{
|
||||
try {
|
||||
UIApplication.Main (args, null, "AppDelegate");
|
||||
} catch (Exception e) {
|
||||
Console.WriteLine (e.ToString ());
|
||||
}
|
||||
}
|
||||
}
|
||||
[Register("AppDelegate")]
|
||||
public class AppDelegate : UIApplicationDelegate
|
||||
{
|
||||
protected UIWindow window;
|
||||
protected HomeScreen iPhoneHome;
|
||||
|
||||
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
|
||||
{
|
||||
window = new UIWindow (UIScreen.MainScreen.Bounds);
|
||||
window.MakeKeyAndVisible ();
|
||||
|
||||
iPhoneHome = new HomeScreen();
|
||||
iPhoneHome.View.Frame = new CoreGraphics.CGRect(0
|
||||
, UIApplication.SharedApplication.StatusBarFrame.Height
|
||||
, UIScreen.MainScreen.ApplicationFrame.Width
|
||||
, UIScreen.MainScreen.ApplicationFrame.Height);
|
||||
|
||||
window.AddSubview (iPhoneHome.View);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{15D8E98D-D803-4CCC-906F-0960D31DD333}</ProjectGuid>
|
||||
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>BasicTable</RootNamespace>
|
||||
<AssemblyName>Example_EditableTable</AssemblyName>
|
||||
<TargetFrameworkIdentifier>Xamarin.iOS</TargetFrameworkIdentifier>
|
||||
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchI18n>
|
||||
</MtouchI18n>
|
||||
<MtouchUseArmv7>false</MtouchUseArmv7>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchI18n>
|
||||
</MtouchI18n>
|
||||
<MtouchUseArmv7>false</MtouchUseArmv7>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhone\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchI18n>
|
||||
</MtouchI18n>
|
||||
<MtouchUseArmv7>false</MtouchUseArmv7>
|
||||
<IpaPackageName>
|
||||
</IpaPackageName>
|
||||
<MtouchArch>ARMv7</MtouchArch>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhone\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchI18n>
|
||||
</MtouchI18n>
|
||||
<MtouchUseArmv7>false</MtouchUseArmv7>
|
||||
<MtouchArch>ARMv7, ARM64</MtouchArch>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Xamarin.iOS" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AppDelegate.cs" />
|
||||
<Compile Include="TableSource.cs" />
|
||||
<Compile Include="HomeScreen.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Images\" />
|
||||
<Folder Include="Images\Icons\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Images\Icons\29_icon.png" />
|
||||
<Content Include="Images\Icons\50_icon.png" />
|
||||
<Content Include="Images\Icons\57_icon.png" />
|
||||
<Content Include="Images\Icons\58_icon.png" />
|
||||
<Content Include="Images\Icons\72_icon.png" />
|
||||
<Content Include="Images\Icons\114_icon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Info.plist" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<ITunesArtwork Include="Images\Icons\512_icon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\Default-568h%402x.png" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasicTable", "BasicTable.csproj", "{15D8E98D-D803-4CCC-906F-0960D31DD333}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|iPhoneSimulator = Debug|iPhoneSimulator
|
||||
Release|iPhoneSimulator = Release|iPhoneSimulator
|
||||
Debug|iPhone = Debug|iPhone
|
||||
Release|iPhone = Release|iPhone
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{15D8E98D-D803-4CCC-906F-0960D31DD333}.Debug|iPhone.ActiveCfg = Debug|iPhone
|
||||
{15D8E98D-D803-4CCC-906F-0960D31DD333}.Debug|iPhone.Build.0 = Debug|iPhone
|
||||
{15D8E98D-D803-4CCC-906F-0960D31DD333}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
|
||||
{15D8E98D-D803-4CCC-906F-0960D31DD333}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
|
||||
{15D8E98D-D803-4CCC-906F-0960D31DD333}.Release|iPhone.ActiveCfg = Release|iPhone
|
||||
{15D8E98D-D803-4CCC-906F-0960D31DD333}.Release|iPhone.Build.0 = Release|iPhone
|
||||
{15D8E98D-D803-4CCC-906F-0960D31DD333}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
|
||||
{15D8E98D-D803-4CCC-906F-0960D31DD333}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
|
||||
EndGlobalSection
|
||||
GlobalSection(MonoDevelopProperties) = preSolution
|
||||
StartupItem = BasicTable.csproj
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,43 @@
|
|||
using System;
|
||||
using CoreGraphics;
|
||||
using System.Collections.Generic;
|
||||
using UIKit;
|
||||
|
||||
namespace BasicTable {
|
||||
public class HomeScreen : UIViewController {
|
||||
UITableView table;
|
||||
|
||||
public HomeScreen ()
|
||||
{
|
||||
}
|
||||
|
||||
public override void ViewDidLoad ()
|
||||
{
|
||||
base.ViewDidLoad ();
|
||||
var width = View.Bounds.Width;
|
||||
var height = View.Bounds.Height;
|
||||
|
||||
table = new UITableView(new CGRect(0, 0, width, height));
|
||||
table.AutoresizingMask = UIViewAutoresizing.All;
|
||||
CreateTableItems();
|
||||
Add (table);
|
||||
}
|
||||
|
||||
protected void CreateTableItems ()
|
||||
{
|
||||
List<string> tableItems = new List<string> ();
|
||||
tableItems.Add ("Vegetables");
|
||||
tableItems.Add ("Fruits");
|
||||
tableItems.Add ("Flower Buds");
|
||||
tableItems.Add ("Legumes");
|
||||
tableItems.Add ("Bulbs");
|
||||
tableItems.Add ("Tubers");
|
||||
table.Source = new TableSource(tableItems.ToArray(), this);
|
||||
}
|
||||
|
||||
public override bool PrefersStatusBarHidden ()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/1 - BasicTable/Images/Icons/114_icon.png
Executable file
После Ширина: | Высота: | Размер: 20 KiB |
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/1 - BasicTable/Images/Icons/29_icon.png
Executable file
После Ширина: | Высота: | Размер: 2.9 KiB |
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/1 - BasicTable/Images/Icons/50_icon.png
Executable file
После Ширина: | Высота: | Размер: 5.8 KiB |
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/1 - BasicTable/Images/Icons/512_icon.png
Executable file
После Ширина: | Высота: | Размер: 318 KiB |
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/1 - BasicTable/Images/Icons/57_icon.png
Executable file
После Ширина: | Высота: | Размер: 7.1 KiB |
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/1 - BasicTable/Images/Icons/58_icon.png
Executable file
После Ширина: | Высота: | Размер: 7.3 KiB |
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/1 - BasicTable/Images/Icons/72_icon.png
Executable file
После Ширина: | Высота: | Размер: 10 KiB |
|
@ -0,0 +1,31 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>Basic Table</string>
|
||||
<key>CFBundleIconFiles</key>
|
||||
<array>
|
||||
<string>Images/Icons/57_icon.png</string>
|
||||
<string>Images/Icons/114_icon.png</string>
|
||||
<string>Images/Icons/72_icon.png</string>
|
||||
<string>Images/Icons/29_icon.png</string>
|
||||
<string>Images/Icons/58_icon.png</string>
|
||||
<string>Images/Icons/50_icon.png</string>
|
||||
</array>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.xamarin.samples.basictable</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>5.1.1</string>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/1 - BasicTable/Resources/Default-568h@2x.png
Normal file
После Ширина: | Высота: | Размер: 61 KiB |
|
@ -0,0 +1,72 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
namespace BasicTable {
|
||||
public class TableSource : UITableViewSource {
|
||||
|
||||
protected string[] tableItems;
|
||||
protected string cellIdentifier = "TableCell";
|
||||
HomeScreen owner;
|
||||
|
||||
public TableSource (string[] items, HomeScreen owner)
|
||||
{
|
||||
tableItems = items;
|
||||
this.owner = owner;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called by the TableView to determine how many sections(groups) there are.
|
||||
/// </summary>
|
||||
public override nint NumberOfSections (UITableView tableView)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called by the TableView to determine how many cells to create for that particular section.
|
||||
/// </summary>
|
||||
public override nint RowsInSection (UITableView tableview, nint section)
|
||||
{
|
||||
return tableItems.Length;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when a row is touched
|
||||
/// </summary>
|
||||
public override void RowSelected (UITableView tableView, NSIndexPath indexPath)
|
||||
{
|
||||
UIAlertController okAlertController = UIAlertController.Create ("Row Selected", tableItems[indexPath.Row], UIAlertControllerStyle.Alert);
|
||||
okAlertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null));
|
||||
owner.PresentViewController (okAlertController, true, null);
|
||||
|
||||
tableView.DeselectRow (indexPath, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called by the TableView to get the actual UITableViewCell to render for the particular row
|
||||
/// </summary>
|
||||
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath)
|
||||
{
|
||||
UITableViewCell cell = tableView.DequeueReusableCell (cellIdentifier);
|
||||
string item = tableItems[indexPath.Row];
|
||||
|
||||
//---- if there are no cells to reuse, create a new one
|
||||
if (cell == null)
|
||||
{ cell = new UITableViewCell (UITableViewCellStyle.Default, cellIdentifier); }
|
||||
|
||||
cell.TextLabel.Text = item;
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
||||
// public override string TitleForHeader (UITableView tableView, nint section)
|
||||
// {
|
||||
// return " ";
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
using System;
|
||||
using UIKit;
|
||||
using Foundation;
|
||||
|
||||
namespace BasicTable {
|
||||
public class Application {
|
||||
public static void Main (string[] args)
|
||||
{
|
||||
try {
|
||||
UIApplication.Main (args, null, "AppDelegate");
|
||||
} catch (Exception e) {
|
||||
Console.WriteLine (e.ToString ());
|
||||
}
|
||||
}
|
||||
}
|
||||
[Register("AppDelegate")]
|
||||
public class AppDelegate : UIApplicationDelegate
|
||||
{
|
||||
protected UIWindow window;
|
||||
protected HomeScreen iPhoneHome;
|
||||
|
||||
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
|
||||
{
|
||||
window = new UIWindow (UIScreen.MainScreen.Bounds);
|
||||
window.MakeKeyAndVisible ();
|
||||
|
||||
iPhoneHome = new HomeScreen();
|
||||
iPhoneHome.View.Frame = new CoreGraphics.CGRect(0
|
||||
, UIApplication.SharedApplication.StatusBarFrame.Height
|
||||
, UIScreen.MainScreen.ApplicationFrame.Width
|
||||
, UIScreen.MainScreen.ApplicationFrame.Height);
|
||||
|
||||
window.AddSubview (iPhoneHome.View);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,111 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{15D8E98D-D803-4CCC-906F-0960D31DD333}</ProjectGuid>
|
||||
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>BasicTable</RootNamespace>
|
||||
<AssemblyName>Example_EditableTable</AssemblyName>
|
||||
<TargetFrameworkIdentifier>Xamarin.iOS</TargetFrameworkIdentifier>
|
||||
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchI18n>
|
||||
</MtouchI18n>
|
||||
<MtouchUseArmv7>false</MtouchUseArmv7>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchI18n>
|
||||
</MtouchI18n>
|
||||
<MtouchUseArmv7>false</MtouchUseArmv7>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhone\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchI18n>
|
||||
</MtouchI18n>
|
||||
<MtouchUseArmv7>false</MtouchUseArmv7>
|
||||
<IpaPackageName>
|
||||
</IpaPackageName>
|
||||
<MtouchArch>ARMv7</MtouchArch>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhone\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchI18n>
|
||||
</MtouchI18n>
|
||||
<MtouchUseArmv7>false</MtouchUseArmv7>
|
||||
<MtouchArch>ARMv7, ARM64</MtouchArch>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Xamarin.iOS" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AppDelegate.cs" />
|
||||
<Compile Include="TableSource.cs" />
|
||||
<Compile Include="HomeScreen.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Images\" />
|
||||
<Folder Include="Images\Icons\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Images\Icons\29_icon.png" />
|
||||
<Content Include="Images\Icons\50_icon.png" />
|
||||
<Content Include="Images\Icons\57_icon.png" />
|
||||
<Content Include="Images\Icons\58_icon.png" />
|
||||
<Content Include="Images\Icons\72_icon.png" />
|
||||
<Content Include="Images\Icons\114_icon.png" />
|
||||
<Content Include="VegeData.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Info.plist" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ITunesArtwork Include="Images\Icons\512_icon.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\Icon-60%402x.png" />
|
||||
<BundleResource Include="Resources\Icon%402x.png" />
|
||||
<BundleResource Include="Resources\Icon.png" />
|
||||
<BundleResource Include="Resources\Default-568h%402x.png" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasicTableIndex", "BasicTableIndex.csproj", "{15D8E98D-D803-4CCC-906F-0960D31DD333}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|iPhoneSimulator = Debug|iPhoneSimulator
|
||||
Release|iPhoneSimulator = Release|iPhoneSimulator
|
||||
Debug|iPhone = Debug|iPhone
|
||||
Release|iPhone = Release|iPhone
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{15D8E98D-D803-4CCC-906F-0960D31DD333}.Debug|iPhone.ActiveCfg = Debug|iPhone
|
||||
{15D8E98D-D803-4CCC-906F-0960D31DD333}.Debug|iPhone.Build.0 = Debug|iPhone
|
||||
{15D8E98D-D803-4CCC-906F-0960D31DD333}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
|
||||
{15D8E98D-D803-4CCC-906F-0960D31DD333}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
|
||||
{15D8E98D-D803-4CCC-906F-0960D31DD333}.Release|iPhone.ActiveCfg = Release|iPhone
|
||||
{15D8E98D-D803-4CCC-906F-0960D31DD333}.Release|iPhone.Build.0 = Release|iPhone
|
||||
{15D8E98D-D803-4CCC-906F-0960D31DD333}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
|
||||
{15D8E98D-D803-4CCC-906F-0960D31DD333}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
|
||||
EndGlobalSection
|
||||
GlobalSection(MonoDevelopProperties) = preSolution
|
||||
StartupItem = BasicTableIndex.csproj
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,37 @@
|
|||
using System;
|
||||
using CoreGraphics;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UIKit;
|
||||
|
||||
namespace BasicTable {
|
||||
public class HomeScreen : UIViewController {
|
||||
UITableView table;
|
||||
|
||||
public HomeScreen ()
|
||||
{
|
||||
}
|
||||
|
||||
public override void ViewDidLoad ()
|
||||
{
|
||||
base.ViewDidLoad ();
|
||||
table = new UITableView(View.Bounds); // defaults to Plain style
|
||||
table.AutoresizingMask = UIViewAutoresizing.All;
|
||||
|
||||
// Credit for test data to
|
||||
// http://en.wikipedia.org/wiki/List_of_culinary_vegetables
|
||||
var lines = File.ReadLines("VegeData.txt");
|
||||
List<string> veges = new List<string>();
|
||||
foreach (var l in lines) {
|
||||
veges.Add (l);
|
||||
}
|
||||
veges.Sort ((x,y) => {return x.CompareTo (y);});
|
||||
string[] tableItems = veges.ToArray();
|
||||
|
||||
|
||||
table.Source = new TableSource(tableItems,this);
|
||||
Add (table);
|
||||
}
|
||||
}
|
||||
}
|
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/2 - BasicTableIndex/Images/Icons/114_icon.png
Executable file
После Ширина: | Высота: | Размер: 20 KiB |
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/2 - BasicTableIndex/Images/Icons/29_icon.png
Executable file
После Ширина: | Высота: | Размер: 2.9 KiB |
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/2 - BasicTableIndex/Images/Icons/50_icon.png
Executable file
После Ширина: | Высота: | Размер: 5.8 KiB |
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/2 - BasicTableIndex/Images/Icons/512_icon.png
Executable file
После Ширина: | Высота: | Размер: 318 KiB |
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/2 - BasicTableIndex/Images/Icons/57_icon.png
Executable file
После Ширина: | Высота: | Размер: 7.1 KiB |
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/2 - BasicTableIndex/Images/Icons/58_icon.png
Executable file
После Ширина: | Высота: | Размер: 7.3 KiB |
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/2 - BasicTableIndex/Images/Icons/72_icon.png
Executable file
После Ширина: | Высота: | Размер: 10 KiB |
|
@ -0,0 +1,32 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>Basic Table Index</string>
|
||||
<key>CFBundleIconFiles</key>
|
||||
<array>
|
||||
<string>Icon</string>
|
||||
<string>Icon@2x</string>
|
||||
<string>Images/Icons/72_icon.png</string>
|
||||
<string>Images/Icons/29_icon.png</string>
|
||||
<string>Images/Icons/58_icon.png</string>
|
||||
<string>Images/Icons/50_icon.png</string>
|
||||
<string>Icon-60@2x</string>
|
||||
</array>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.xamarin.samples.basictableindex</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>5.1.1</string>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/2 - BasicTableIndex/Resources/Default-568h@2x.png
Normal file
После Ширина: | Высота: | Размер: 61 KiB |
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/2 - BasicTableIndex/Resources/Icon-60@2x.png
Normal file
После Ширина: | Высота: | Размер: 7.0 KiB |
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/2 - BasicTableIndex/Resources/Icon.png
Normal file
После Ширина: | Высота: | Размер: 4.7 KiB |
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/2 - BasicTableIndex/Resources/Icon@2x.png
Normal file
После Ширина: | Высота: | Размер: 6.8 KiB |
|
@ -0,0 +1,82 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
namespace BasicTable {
|
||||
public class TableSource : UITableViewSource {
|
||||
string cellIdentifier = "TableCell";
|
||||
|
||||
Dictionary<string, List<string>> indexedTableItems;
|
||||
string[] keys;
|
||||
HomeScreen owner;
|
||||
|
||||
public TableSource (string[] items, HomeScreen owner)
|
||||
{
|
||||
this.owner = owner;
|
||||
|
||||
indexedTableItems = new Dictionary<string, List<string>>();
|
||||
foreach (var t in items) {
|
||||
if (indexedTableItems.ContainsKey (t[0].ToString ())) {
|
||||
indexedTableItems[t[0].ToString ()].Add(t);
|
||||
} else {
|
||||
indexedTableItems.Add (t[0].ToString (), new List<string>() {t});
|
||||
}
|
||||
}
|
||||
keys = indexedTableItems.Keys.ToArray ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called by the TableView to determine how many sections(groups) there are.
|
||||
/// </summary>
|
||||
public override nint NumberOfSections (UITableView tableView)
|
||||
{
|
||||
return keys.Length;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called by the TableView to determine how many cells to create for that particular section.
|
||||
/// </summary>
|
||||
public override nint RowsInSection (UITableView tableview, nint section)
|
||||
{
|
||||
return indexedTableItems[keys[section]].Count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sections the index titles.
|
||||
/// </summary>
|
||||
public override String[] SectionIndexTitles (UITableView tableView)
|
||||
{
|
||||
return indexedTableItems.Keys.ToArray ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when a row is touched
|
||||
/// </summary>
|
||||
public override void RowSelected (UITableView tableView, NSIndexPath indexPath)
|
||||
{
|
||||
UIAlertController okAlertController = UIAlertController.Create ("Row Selected", indexedTableItems[keys[indexPath.Section]][indexPath.Row], UIAlertControllerStyle.Alert);
|
||||
okAlertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null));
|
||||
owner.PresentViewController (okAlertController, true, null);
|
||||
tableView.DeselectRow (indexPath, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called by the TableView to get the actual UITableViewCell to render for the particular row
|
||||
/// </summary>
|
||||
public override UITableViewCell GetCell (UITableView tableView, 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);
|
||||
|
||||
cell.TextLabel.Text = indexedTableItems[keys[indexPath.Section]][indexPath.Row];
|
||||
|
||||
return cell;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,181 @@
|
|||
Beet greens
|
||||
Bitterleaf
|
||||
Bok choy
|
||||
Broccoli Rabe
|
||||
Brussels sprout
|
||||
Cabbage
|
||||
Catsear
|
||||
Celery
|
||||
Celtuce
|
||||
Ceylon spinach
|
||||
Chard
|
||||
Chaya
|
||||
Chickweed
|
||||
Chicory
|
||||
Chinese cabbage
|
||||
Chinese Mallow
|
||||
Chrysanthemum leaves
|
||||
Collard greens
|
||||
Corn salad
|
||||
Cress
|
||||
Dandelion
|
||||
Endive
|
||||
Epazote
|
||||
Fat hen
|
||||
Fiddlehead
|
||||
Fluted pumpkin
|
||||
Garden Rocket
|
||||
Golden samphire
|
||||
Good King Henry
|
||||
Greater Plantain
|
||||
Kai-lan
|
||||
Kale
|
||||
Komatsuna
|
||||
Kuka
|
||||
Lagos bologi
|
||||
Lamb's lettuce
|
||||
Land cress
|
||||
Lettuce
|
||||
Lizard's tail
|
||||
Melokhia
|
||||
Mizuna greens
|
||||
Mustard
|
||||
Napa cabbage
|
||||
New Zealand Spinach
|
||||
Orache
|
||||
Pak choy
|
||||
Paracress
|
||||
Pea sprouts/leaves
|
||||
Poke
|
||||
Radicchio
|
||||
Samphire
|
||||
Sea beet
|
||||
Sea kale
|
||||
Sierra Leone bologi
|
||||
Soko
|
||||
Sorrel
|
||||
Spinach
|
||||
Summer purslane
|
||||
Swiss chard
|
||||
Tatsoi
|
||||
Turnip greens
|
||||
Watercress
|
||||
Water spinach
|
||||
Winter purslane
|
||||
Yarrow
|
||||
Avocado
|
||||
Bell pepper
|
||||
Bitter melon/Bitter gourd
|
||||
Courgette
|
||||
Cucumber
|
||||
Ivy Gourd
|
||||
Eggplant/Aubergine/Brinjal
|
||||
Pumpkin
|
||||
Squash
|
||||
Sweet corn aka corn; aka maize
|
||||
Sweet pepper
|
||||
Tinda
|
||||
Tomatillo
|
||||
Tomato
|
||||
Winter melon
|
||||
West Indian gherkin
|
||||
Zucchini
|
||||
Artichoke
|
||||
Broccoli
|
||||
Cauliflower
|
||||
Courgette flowers
|
||||
Squash blossoms
|
||||
American groundnut
|
||||
Azuki bean
|
||||
Black-eyed pea
|
||||
Chickpea
|
||||
Common bean
|
||||
Drumstick
|
||||
Dolichos bean
|
||||
Fava bean
|
||||
Garbanzo
|
||||
Green bean
|
||||
Guar
|
||||
Gumbo
|
||||
Horse gram
|
||||
Indian pea
|
||||
Lentil
|
||||
Lima Bean
|
||||
Moth bean
|
||||
Mung bean
|
||||
Okra
|
||||
Pea
|
||||
Peanut
|
||||
Pigeon pea
|
||||
Ricebean
|
||||
Runner bean
|
||||
Snap pea
|
||||
Snow pea
|
||||
Soybean
|
||||
Tarwi
|
||||
Tepary bean
|
||||
Urad bean
|
||||
Velvet bean
|
||||
Winged bean
|
||||
Yardlong bean
|
||||
Asparagus
|
||||
Cardoon
|
||||
Celeriac
|
||||
Celery
|
||||
Elephant Garlic
|
||||
Florence fennel
|
||||
Garlic
|
||||
Kohlrabi
|
||||
Kurrat
|
||||
Leek
|
||||
Lotus root
|
||||
Nopal
|
||||
Onion
|
||||
Spring Onion/Scallion
|
||||
Prussian asparagus
|
||||
Shallot
|
||||
Welsh onion
|
||||
Wild leek
|
||||
Ahipa
|
||||
Arracacha
|
||||
Bamboo shoot
|
||||
Beetroot
|
||||
Burdock
|
||||
Broadleaf arrowhead
|
||||
Camas
|
||||
Canna
|
||||
Carrot
|
||||
Cassava
|
||||
Chinese artichoke
|
||||
Daikon
|
||||
Earthnut pea
|
||||
Elephant Foot yam
|
||||
Ensete
|
||||
Ginger
|
||||
Gobo
|
||||
Hamburg parsley
|
||||
Jerusalem artichoke
|
||||
Jícama
|
||||
Manioc
|
||||
Mooli
|
||||
Parsnip
|
||||
Pignut
|
||||
Plectranthus
|
||||
Potato
|
||||
Prairie turnip
|
||||
Radish
|
||||
Horseradish
|
||||
Rutabaga
|
||||
Salsify
|
||||
Scorzonera
|
||||
Skirret
|
||||
Swede
|
||||
Sweet Potato or Kumara
|
||||
Taro
|
||||
Ti
|
||||
Tigernut
|
||||
Turnip
|
||||
Ulluco
|
||||
Water chestnut
|
||||
Yacón
|
||||
Yam
|
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
using UIKit;
|
||||
using Foundation;
|
||||
|
||||
namespace BasicTable {
|
||||
[Register("AppDelegate")]
|
||||
public class AppDelegate : UIApplicationDelegate
|
||||
{
|
||||
protected UIWindow window;
|
||||
protected HomeScreen iPhoneHome;
|
||||
|
||||
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
|
||||
{
|
||||
window = new UIWindow (UIScreen.MainScreen.Bounds);
|
||||
window.MakeKeyAndVisible ();
|
||||
|
||||
iPhoneHome = new HomeScreen();
|
||||
iPhoneHome.View.Frame = new CoreGraphics.CGRect(0
|
||||
, UIApplication.SharedApplication.StatusBarFrame.Height
|
||||
, UIScreen.MainScreen.ApplicationFrame.Width
|
||||
, UIScreen.MainScreen.ApplicationFrame.Height);
|
||||
|
||||
window.AddSubview (iPhoneHome.View);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using UIKit;
|
||||
|
||||
namespace Example_EditableTable
|
||||
{
|
||||
public class Application// : UIApplication
|
||||
{
|
||||
public static void Main (string[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
UIApplication.Main (args, null, "AppDelegate");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine (e.ToString ());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,113 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{15D8E98D-D803-4CCC-906F-0960D31DD333}</ProjectGuid>
|
||||
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>BasicTable</RootNamespace>
|
||||
<AssemblyName>Example_EditableTable</AssemblyName>
|
||||
<TargetFrameworkIdentifier>Xamarin.iOS</TargetFrameworkIdentifier>
|
||||
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchI18n>
|
||||
</MtouchI18n>
|
||||
<MtouchUseArmv7>false</MtouchUseArmv7>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchI18n>
|
||||
</MtouchI18n>
|
||||
<MtouchUseArmv7>false</MtouchUseArmv7>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhone\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchI18n>
|
||||
</MtouchI18n>
|
||||
<MtouchUseArmv7>false</MtouchUseArmv7>
|
||||
<IpaPackageName>
|
||||
</IpaPackageName>
|
||||
<MtouchArch>ARMv7</MtouchArch>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhone\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchI18n>
|
||||
</MtouchI18n>
|
||||
<MtouchUseArmv7>false</MtouchUseArmv7>
|
||||
<MtouchArch>ARMv7, ARM64</MtouchArch>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Xamarin.iOS" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AppDelegate.cs" />
|
||||
<Compile Include="Application.cs" />
|
||||
<Compile Include="Code\TableItem.cs" />
|
||||
<Compile Include="Code\TableItemGroup.cs" />
|
||||
<Compile Include="Code\TableSource.cs" />
|
||||
<Compile Include="Screens\HomeScreen.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Images\" />
|
||||
<Folder Include="Images\Icons\" />
|
||||
<Folder Include="Code\" />
|
||||
<Folder Include="Screens\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Images\Icons\29_icon.png" />
|
||||
<Content Include="Images\Icons\50_icon.png" />
|
||||
<Content Include="Images\Icons\57_icon.png" />
|
||||
<Content Include="Images\Icons\58_icon.png" />
|
||||
<Content Include="Images\Icons\72_icon.png" />
|
||||
<Content Include="Images\Icons\114_icon.png" />
|
||||
<Content Include="VegeData2.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Info.plist" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<ITunesArtwork Include="Images\Icons\512_icon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\Default-568h%402x.png" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasicTableHeaderFooter", "BasicTableHeaderFooter.csproj", "{15D8E98D-D803-4CCC-906F-0960D31DD333}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|iPhoneSimulator = Debug|iPhoneSimulator
|
||||
Release|iPhoneSimulator = Release|iPhoneSimulator
|
||||
Debug|iPhone = Debug|iPhone
|
||||
Release|iPhone = Release|iPhone
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{15D8E98D-D803-4CCC-906F-0960D31DD333}.Debug|iPhone.ActiveCfg = Debug|iPhone
|
||||
{15D8E98D-D803-4CCC-906F-0960D31DD333}.Debug|iPhone.Build.0 = Debug|iPhone
|
||||
{15D8E98D-D803-4CCC-906F-0960D31DD333}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
|
||||
{15D8E98D-D803-4CCC-906F-0960D31DD333}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
|
||||
{15D8E98D-D803-4CCC-906F-0960D31DD333}.Release|iPhone.ActiveCfg = Release|iPhone
|
||||
{15D8E98D-D803-4CCC-906F-0960D31DD333}.Release|iPhone.Build.0 = Release|iPhone
|
||||
{15D8E98D-D803-4CCC-906F-0960D31DD333}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
|
||||
{15D8E98D-D803-4CCC-906F-0960D31DD333}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
|
||||
EndGlobalSection
|
||||
GlobalSection(MonoDevelopProperties) = preSolution
|
||||
StartupItem = BasicTableHeaderFooter.csproj
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
using UIKit;
|
||||
|
||||
namespace BasicTable {
|
||||
public class TableItem {
|
||||
public string Heading { get; set; }
|
||||
|
||||
public string SubHeading { get; set; }
|
||||
|
||||
public string ImageName { get; set; }
|
||||
|
||||
public UITableViewCellStyle CellStyle
|
||||
{
|
||||
get { return cellStyle; }
|
||||
set { cellStyle = value; }
|
||||
}
|
||||
protected UITableViewCellStyle cellStyle = UITableViewCellStyle.Default;
|
||||
|
||||
public UITableViewCellAccessory CellAccessory
|
||||
{
|
||||
get { return cellAccessory; }
|
||||
set { cellAccessory = value; }
|
||||
}
|
||||
protected UITableViewCellAccessory cellAccessory = UITableViewCellAccessory.None;
|
||||
|
||||
public TableItem () { }
|
||||
|
||||
public TableItem (string heading)
|
||||
{ Heading = heading; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UIKit;
|
||||
|
||||
namespace BasicTable {
|
||||
/// <summary>
|
||||
/// A group that contains table items
|
||||
/// </summary>
|
||||
public class TableItemGroup {
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Footer { get; set; }
|
||||
|
||||
public List<TableItem> Items
|
||||
{
|
||||
get { return items; }
|
||||
set { items = value; }
|
||||
}
|
||||
protected List<TableItem> items = new List<TableItem> ();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,110 @@
|
|||
using System;
|
||||
using UIKit;
|
||||
using System.Collections.Generic;
|
||||
using Foundation;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace BasicTable {
|
||||
public class TableSource : UITableViewSource {
|
||||
protected string cellIdentifier = "TableCell";
|
||||
|
||||
Dictionary<string, List<TableItem>> indexedTableItems;
|
||||
string[] keys;
|
||||
HomeScreen owner;
|
||||
|
||||
public TableSource (List<TableItem> items, HomeScreen owner)
|
||||
{
|
||||
this.owner = owner;
|
||||
|
||||
indexedTableItems = new Dictionary<string, List<TableItem>>();
|
||||
foreach (var t in items) {
|
||||
if (indexedTableItems.ContainsKey (t.SubHeading)) {
|
||||
indexedTableItems[t.SubHeading].Add(t);
|
||||
} else {
|
||||
indexedTableItems.Add (t.SubHeading, new List<TableItem>() {t});
|
||||
}
|
||||
}
|
||||
keys = indexedTableItems.Keys.ToArray ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called by the TableView to determine how many sections(groups) there are.
|
||||
/// </summary>
|
||||
public override nint NumberOfSections (UITableView tableView)
|
||||
{
|
||||
return keys.Length;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called by the TableView to determine how many cells to create for that particular section.
|
||||
/// </summary>
|
||||
public override nint RowsInSection (UITableView tableview, nint section)
|
||||
{
|
||||
return indexedTableItems[keys[section]].Count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sections the index titles.
|
||||
/// </summary>
|
||||
// public override string[] SectionIndexTitles (UITableView tableView)
|
||||
// {
|
||||
// return indexedTableItems.Keys.ToArray ();
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// The string to show in the section header
|
||||
/// </summary>
|
||||
public override string TitleForHeader (UITableView tableView, nint section)
|
||||
{
|
||||
return keys[section];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The string to show in the section footer
|
||||
/// </summary>
|
||||
public override string TitleForFooter (UITableView tableView, nint section)
|
||||
{
|
||||
return indexedTableItems[keys[section]].Count + " items";
|
||||
}
|
||||
|
||||
public override void RowSelected (UITableView tableView, NSIndexPath indexPath)
|
||||
{
|
||||
UIAlertController okAlertController = UIAlertController.Create ("Row Selected", indexedTableItems[keys[indexPath.Section]][indexPath.Row].Heading, UIAlertControllerStyle.Alert);
|
||||
okAlertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null));
|
||||
owner.PresentViewController (okAlertController, true, null);
|
||||
|
||||
tableView.DeselectRow (indexPath, true);
|
||||
}
|
||||
|
||||
|
||||
/// <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);
|
||||
TableItem item = indexedTableItems[keys[indexPath.Section]][indexPath.Row];
|
||||
|
||||
//---- if there are no cells to reuse, create a new one
|
||||
if (cell == null)
|
||||
{ cell = new UITableViewCell (item.CellStyle, cellIdentifier); }
|
||||
|
||||
//---- set the item text
|
||||
cell.TextLabel.Text = item.Heading;
|
||||
|
||||
//---- 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 = item.CellAccessory;
|
||||
|
||||
return cell;
|
||||
}
|
||||
}
|
||||
}
|
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/3 - BasicTableHeaderFooter/Images/Icons/114_icon.png
Executable file
После Ширина: | Высота: | Размер: 20 KiB |
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/3 - BasicTableHeaderFooter/Images/Icons/29_icon.png
Executable file
После Ширина: | Высота: | Размер: 2.9 KiB |
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/3 - BasicTableHeaderFooter/Images/Icons/50_icon.png
Executable file
После Ширина: | Высота: | Размер: 5.8 KiB |
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/3 - BasicTableHeaderFooter/Images/Icons/512_icon.png
Executable file
После Ширина: | Высота: | Размер: 318 KiB |
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/3 - BasicTableHeaderFooter/Images/Icons/57_icon.png
Executable file
После Ширина: | Высота: | Размер: 7.1 KiB |
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/3 - BasicTableHeaderFooter/Images/Icons/58_icon.png
Executable file
После Ширина: | Высота: | Размер: 7.3 KiB |
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/3 - BasicTableHeaderFooter/Images/Icons/72_icon.png
Executable file
После Ширина: | Высота: | Размер: 10 KiB |
|
@ -0,0 +1,31 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>Basic Table Header-Footer</string>
|
||||
<key>CFBundleIconFiles</key>
|
||||
<array>
|
||||
<string>Images/Icons/57_icon.png</string>
|
||||
<string>Images/Icons/114_icon.png</string>
|
||||
<string>Images/Icons/72_icon.png</string>
|
||||
<string>Images/Icons/29_icon.png</string>
|
||||
<string>Images/Icons/58_icon.png</string>
|
||||
<string>Images/Icons/50_icon.png</string>
|
||||
</array>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.xamarin.samples.basictableheaderfooter</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>8.3</string>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
Двоичные данные
WorkingWithTables/Part 2 - Populating a table with data/3 - BasicTableHeaderFooter/Resources/Default-568h@2x.png
Normal file
После Ширина: | Высота: | Размер: 61 KiB |
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
using CoreGraphics;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using UIKit;
|
||||
|
||||
namespace BasicTable {
|
||||
public class HomeScreen : UIViewController {
|
||||
UITableView table;
|
||||
|
||||
public HomeScreen ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void ViewDidLoad ()
|
||||
{
|
||||
base.ViewDidLoad ();
|
||||
table = new UITableView (View.Bounds, UITableViewStyle.Grouped);
|
||||
table.AutoresizingMask = UIViewAutoresizing.All;
|
||||
CreateTableItems();
|
||||
Add (table);
|
||||
}
|
||||
|
||||
protected void CreateTableItems ()
|
||||
{
|
||||
List<TableItem> veges = new List<TableItem>();
|
||||
|
||||
// Credit for test data to
|
||||
// http://en.wikipedia.org/wiki/List_of_culinary_vegetables
|
||||
var lines = File.ReadLines("VegeData2.txt");
|
||||
foreach (var line in lines) {
|
||||
var vege = line.Split(',');
|
||||
veges.Add (new TableItem(vege[1]) {SubHeading=vege[0]} );
|
||||
}
|
||||
|
||||
table.Source = new TableSource(veges, this);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,181 @@
|
|||
Vegetables,Beet greens
|
||||
Vegetables,Bitterleaf
|
||||
Vegetables,Bok choy
|
||||
Vegetables,Broccoli Rabe
|
||||
Vegetables,Brussels sprout
|
||||
Vegetables,Cabbage
|
||||
Vegetables,Catsear
|
||||
Vegetables,Celery
|
||||
Vegetables,Celtuce
|
||||
Vegetables,Ceylon spinach
|
||||
Vegetables,Chard
|
||||
Vegetables,Chaya
|
||||
Vegetables,Chickweed
|
||||
Vegetables,Chicory
|
||||
Vegetables,Chinese cabbage
|
||||
Vegetables,Chinese Mallow
|
||||
Vegetables,Chrysanthemum leaves
|
||||
Vegetables,Collard greens
|
||||
Vegetables,Corn salad
|
||||
Vegetables,Cress
|
||||
Vegetables,Dandelion
|
||||
Vegetables,Endive
|
||||
Vegetables,Epazote
|
||||
Vegetables,Fat hen
|
||||
Vegetables,Fiddlehead
|
||||
Vegetables,Fluted pumpkin
|
||||
Vegetables,Garden Rocket
|
||||
Vegetables,Golden samphire
|
||||
Vegetables,Good King Henry
|
||||
Vegetables,Greater Plantain
|
||||
Vegetables,Kai-lan
|
||||
Vegetables,Kale
|
||||
Vegetables,Komatsuna
|
||||
Vegetables,Kuka
|
||||
Vegetables,Lagos bologi
|
||||
Vegetables,Lamb's lettuce
|
||||
Vegetables,Land cress
|
||||
Vegetables,Lettuce
|
||||
Vegetables,Lizard's tail
|
||||
Vegetables,Melokhia
|
||||
Vegetables,Mizuna greens
|
||||
Vegetables,Mustard
|
||||
Vegetables,Napa cabbage
|
||||
Vegetables,New Zealand Spinach
|
||||
Vegetables,Orache
|
||||
Vegetables,Pak choy
|
||||
Vegetables,Paracress
|
||||
Vegetables,Pea sprouts/leaves
|
||||
Vegetables,Poke
|
||||
Vegetables,Radicchio
|
||||
Vegetables,Samphire
|
||||
Vegetables,Sea beet
|
||||
Vegetables,Sea kale
|
||||
Vegetables,Sierra Leone bologi
|
||||
Vegetables,Soko
|
||||
Vegetables,Sorrel
|
||||
Vegetables,Spinach
|
||||
Vegetables,Summer purslane
|
||||
Vegetables,Swiss chard
|
||||
Vegetables,Tatsoi
|
||||
Vegetables,Turnip greens
|
||||
Vegetables,Watercress
|
||||
Vegetables,Water spinach
|
||||
Vegetables,Winter purslane
|
||||
Vegetables,Yarrow
|
||||
Fruits,Avocado
|
||||
Fruits,Bell pepper
|
||||
Fruits,Bitter melon/Bitter gourd
|
||||
Fruits,Courgette
|
||||
Fruits,Cucumber
|
||||
Fruits,Ivy Gourd
|
||||
Fruits,Eggplant/Aubergine/Brinjal
|
||||
Fruits,Pumpkin
|
||||
Fruits,Squash
|
||||
Fruits,Sweet corn aka corn; aka maize
|
||||
Fruits,Sweet pepper
|
||||
Fruits,Tinda
|
||||
Fruits,Tomatillo
|
||||
Fruits,Tomato
|
||||
Fruits,Winter melon
|
||||
Fruits,West Indian gherkin
|
||||
Fruits,Zucchini
|
||||
Flower Buds,Artichoke
|
||||
Flower Buds,Broccoli
|
||||
Flower Buds,Cauliflower
|
||||
Flower Buds,Courgette flowers
|
||||
Flower Buds,Squash blossoms
|
||||
Legumes,American groundnut
|
||||
Legumes,Azuki bean
|
||||
Legumes,Black-eyed pea
|
||||
Legumes,Chickpea
|
||||
Legumes,Common bean
|
||||
Legumes,Drumstick
|
||||
Legumes,Dolichos bean
|
||||
Legumes,Fava bean
|
||||
Legumes,Garbanzo
|
||||
Legumes,Green bean
|
||||
Legumes,Guar
|
||||
Legumes,Gumbo
|
||||
Legumes,Horse gram
|
||||
Legumes,Indian pea
|
||||
Legumes,Lentil
|
||||
Legumes,Lima Bean
|
||||
Legumes,Moth bean
|
||||
Legumes,Mung bean
|
||||
Legumes,Okra
|
||||
Legumes,Pea
|
||||
Legumes,Peanut
|
||||
Legumes,Pigeon pea
|
||||
Legumes,Ricebean
|
||||
Legumes,Runner bean
|
||||
Legumes,Snap pea
|
||||
Legumes,Snow pea
|
||||
Legumes,Soybean
|
||||
Legumes,Tarwi
|
||||
Legumes,Tepary bean
|
||||
Legumes,Urad bean
|
||||
Legumes,Velvet bean
|
||||
Legumes,Winged bean
|
||||
Legumes,Yardlong bean
|
||||
Bulbs,Asparagus
|
||||
Bulbs,Cardoon
|
||||
Bulbs,Celeriac
|
||||
Bulbs,Celery
|
||||
Bulbs,Elephant Garlic
|
||||
Bulbs,Florence fennel
|
||||
Bulbs,Garlic
|
||||
Bulbs,Kohlrabi
|
||||
Bulbs,Kurrat
|
||||
Bulbs,Leek
|
||||
Bulbs,Lotus root
|
||||
Bulbs,Nopal
|
||||
Bulbs,Onion
|
||||
Bulbs,Spring Onion/Scallion
|
||||
Bulbs,Prussian asparagus
|
||||
Bulbs,Shallot
|
||||
Bulbs,Welsh onion
|
||||
Bulbs,Wild leek
|
||||
Tubers,Ahipa
|
||||
Tubers,Arracacha
|
||||
Tubers,Bamboo shoot
|
||||
Tubers,Beetroot
|
||||
Tubers,Burdock
|
||||
Tubers,Broadleaf arrowhead
|
||||
Tubers,Camas
|
||||
Tubers,Canna
|
||||
Tubers,Carrot
|
||||
Tubers,Cassava
|
||||
Tubers,Chinese artichoke
|
||||
Tubers,Daikon
|
||||
Tubers,Earthnut pea
|
||||
Tubers,Elephant Foot yam
|
||||
Tubers,Ensete
|
||||
Tubers,Ginger
|
||||
Tubers,Gobo
|
||||
Tubers,Hamburg parsley
|
||||
Tubers,Jerusalem artichoke
|
||||
Tubers,Jícama
|
||||
Tubers,Manioc
|
||||
Tubers,Mooli
|
||||
Tubers,Parsnip
|
||||
Tubers,Pignut
|
||||
Tubers,Plectranthus
|
||||
Tubers,Potato
|
||||
Tubers,Prairie turnip
|
||||
Tubers,Radish
|
||||
Tubers,Horseradish
|
||||
Tubers,Rutabaga
|
||||
Tubers,Salsify
|
||||
Tubers,Scorzonera
|
||||
Tubers,Skirret
|
||||
Tubers,Swede
|
||||
Tubers,Sweet Potato or Kumara
|
||||
Tubers,Taro
|
||||
Tubers,Ti
|
||||
Tubers,Tigernut
|
||||
Tubers,Turnip
|
||||
Tubers,Ulluco
|
||||
Tubers,Water chestnut
|
||||
Tubers,Yacón
|
||||
Tubers,Yam
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PopulatingATable", "PopulatingATable\PopulatingATable.csproj", "{6E95FED4-EC5A-4A0C-9919-45B1A4B92270}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|iPhoneSimulator = Debug|iPhoneSimulator
|
||||
Release|iPhone = Release|iPhone
|
||||
Release|iPhoneSimulator = Release|iPhoneSimulator
|
||||
Debug|iPhone = Debug|iPhone
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{6E95FED4-EC5A-4A0C-9919-45B1A4B92270}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
|
||||
{6E95FED4-EC5A-4A0C-9919-45B1A4B92270}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
|
||||
{6E95FED4-EC5A-4A0C-9919-45B1A4B92270}.Debug|iPhone.ActiveCfg = Debug|iPhone
|
||||
{6E95FED4-EC5A-4A0C-9919-45B1A4B92270}.Debug|iPhone.Build.0 = Debug|iPhone
|
||||
{6E95FED4-EC5A-4A0C-9919-45B1A4B92270}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
|
||||
{6E95FED4-EC5A-4A0C-9919-45B1A4B92270}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
|
||||
{6E95FED4-EC5A-4A0C-9919-45B1A4B92270}.Release|Any CPU.ActiveCfg = Release|iPhone
|
||||
{6E95FED4-EC5A-4A0C-9919-45B1A4B92270}.Release|Any CPU.Build.0 = Release|iPhone
|
||||
{6E95FED4-EC5A-4A0C-9919-45B1A4B92270}.Release|iPhone.ActiveCfg = Release|iPhone
|
||||
{6E95FED4-EC5A-4A0C-9919-45B1A4B92270}.Release|iPhone.Build.0 = Release|iPhone
|
||||
{6E95FED4-EC5A-4A0C-9919-45B1A4B92270}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
|
||||
{6E95FED4-EC5A-4A0C-9919-45B1A4B92270}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,60 @@
|
|||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
namespace PopulatingATable
|
||||
{
|
||||
// The UIApplicationDelegate for the application. This class is responsible for launching the
|
||||
// User Interface of the application, as well as listening (and optionally responding) to application events from iOS.
|
||||
[Register ("AppDelegate")]
|
||||
public class AppDelegate : UIApplicationDelegate
|
||||
{
|
||||
// class-level declarations
|
||||
|
||||
public override UIWindow Window {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
|
||||
{
|
||||
// Override point for customization after application launch.
|
||||
// If not required for your application you can safely delete this method
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnResignActivation (UIApplication application)
|
||||
{
|
||||
// Invoked when the application is about to move from active to inactive state.
|
||||
// This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message)
|
||||
// or when the user quits the application and it begins the transition to the background state.
|
||||
// Games should use this method to pause the game.
|
||||
}
|
||||
|
||||
public override void DidEnterBackground (UIApplication application)
|
||||
{
|
||||
// Use this method to release shared resources, save user data, invalidate timers and store the application state.
|
||||
// If your application supports background exection this method is called instead of WillTerminate when the user quits.
|
||||
}
|
||||
|
||||
public override void WillEnterForeground (UIApplication application)
|
||||
{
|
||||
// Called as part of the transiton from background to active state.
|
||||
// Here you can undo many of the changes made on entering the background.
|
||||
}
|
||||
|
||||
public override void OnActivated (UIApplication application)
|
||||
{
|
||||
// Restart any tasks that were paused (or not yet started) while the application was inactive.
|
||||
// If the application was previously in the background, optionally refresh the user interface.
|
||||
}
|
||||
|
||||
public override void WillTerminate (UIApplication application)
|
||||
{
|
||||
// Called when the application is about to terminate. Save data, if needed. See also DidEnterBackground.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,47 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>PopulatingATable</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.companyname.populatingatable</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>8.3</string>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
<integer>2</integer>
|
||||
</array>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UIMainStoryboardFile~ipad</key>
|
||||
<string>Main</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>XSAppIconAssets</key>
|
||||
<string>Resources/Images.xcassets/AppIcons.appiconset</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,15 @@
|
|||
using UIKit;
|
||||
|
||||
namespace PopulatingATable
|
||||
{
|
||||
public class Application
|
||||
{
|
||||
// This is the main entry point of the application.
|
||||
static void Main (string[] args)
|
||||
{
|
||||
// if you want to use a different Application Delegate class from "AppDelegate"
|
||||
// you can specify it here.
|
||||
UIApplication.Main (args, null, "AppDelegate");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="BYZ-38-t0r">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="tne-QT-ifu">
|
||||
<objects>
|
||||
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="0.0" y="0.0"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<simulatedMetricsContainer key="defaultSimulatedMetrics">
|
||||
<simulatedStatusBarMetrics key="statusBar"/>
|
||||
<simulatedOrientationMetrics key="orientation"/>
|
||||
<simulatedScreenMetrics key="destination"/>
|
||||
</simulatedMetricsContainer>
|
||||
</document>
|
|
@ -0,0 +1,88 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
|
||||
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<ProjectGuid>{6E95FED4-EC5A-4A0C-9919-45B1A4B92270}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>PopulatingATable</RootNamespace>
|
||||
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
|
||||
<AssemblyName>PopulatingATable</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;ENABLE_TEST_CLOUD;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<MtouchArch>i386</MtouchArch>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\iPhone\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
<MtouchArch>ARMv7, ARM64</MtouchArch>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<MtouchArch>i386</MtouchArch>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhone\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;ENABLE_TEST_CLOUD;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<MtouchArch>ARMv7, ARM64</MtouchArch>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Xamarin.iOS" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Contents.json" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<InterfaceDefinition Include="Resources\LaunchScreen.xib" />
|
||||
<InterfaceDefinition Include="Main.storyboard" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Info.plist" />
|
||||
<None Include="Entitlements.plist" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Main.cs" />
|
||||
<Compile Include="AppDelegate.cs" />
|
||||
<Compile Include="ViewController.cs" />
|
||||
<Compile Include="ViewController.designer.cs">
|
||||
<DependentUpon>ViewController.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TableSource.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,108 @@
|
|||
{
|
||||
"images": [
|
||||
{
|
||||
"size": "29x29",
|
||||
"scale": "1x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"size": "29x29",
|
||||
"scale": "2x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"size": "29x29",
|
||||
"scale": "3x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"size": "40x40",
|
||||
"scale": "2x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"size": "40x40",
|
||||
"scale": "3x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"size": "57x57",
|
||||
"scale": "1x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"size": "57x57",
|
||||
"scale": "2x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"size": "60x60",
|
||||
"scale": "2x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"size": "60x60",
|
||||
"scale": "3x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"size": "29x29",
|
||||
"scale": "1x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "29x29",
|
||||
"scale": "2x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "40x40",
|
||||
"scale": "1x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "40x40",
|
||||
"scale": "2x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "50x50",
|
||||
"scale": "1x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "50x50",
|
||||
"scale": "2x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "72x72",
|
||||
"scale": "1x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "72x72",
|
||||
"scale": "2x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "76x76",
|
||||
"scale": "1x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "76x76",
|
||||
"scale": "2x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "120x120",
|
||||
"scale": "1x",
|
||||
"idiom": "car"
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"version": 1,
|
||||
"author": "xcode"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6214" systemVersion="14A314h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6207" />
|
||||
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1" />
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" />
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder" />
|
||||
<view contentMode="scaleToFill" id="iN0-l3-epB">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="480" />
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" />
|
||||
<subviews>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 amyburns" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines"
|
||||
minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
|
||||
<rect key="frame" x="20" y="439" width="441" height="21" />
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17" />
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor" />
|
||||
<nil key="highlightedColor" />
|
||||
</label>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="PopulatingATable" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines"
|
||||
minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
|
||||
<rect key="frame" x="20" y="140" width="441" height="43" />
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="36" />
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor" />
|
||||
<nil key="highlightedColor" />
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite" />
|
||||
<constraints>
|
||||
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC" />
|
||||
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk" />
|
||||
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l" />
|
||||
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0" />
|
||||
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9" />
|
||||
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g" />
|
||||
</constraints>
|
||||
<nil key="simulatedStatusBarMetrics" />
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics" />
|
||||
<point key="canvasLocation" x="548" y="455" />
|
||||
</view>
|
||||
</objects>
|
||||
</document>
|
|
@ -0,0 +1,70 @@
|
|||
using System;
|
||||
using UIKit;
|
||||
using Foundation;
|
||||
|
||||
namespace PopulatingATable
|
||||
{
|
||||
public class TableSource : UITableViewSource
|
||||
{
|
||||
string[] TableItems;
|
||||
const string CellIdentifier = "TableCell";
|
||||
|
||||
|
||||
public TableSource (string[] items)
|
||||
{
|
||||
TableItems = items;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called by the TableView to determine how many sections(groups) there are.
|
||||
/// </summary>
|
||||
public override nint NumberOfSections (UITableView tableView)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public override void RowSelected (UITableView tableView, NSIndexPath indexPath)
|
||||
{
|
||||
new UIAlertView("Row Selected", tableItems[indexPath.Row], null, "OK", null).Show();
|
||||
tableView.DeselectRow (indexPath, true); // normal iOS behaviour is to remove the blue highlight
|
||||
}
|
||||
|
||||
// public string GetTableItem(NSIndexPath indexPath)
|
||||
// {
|
||||
// return TableItems[indexPath.Row];
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Called by the TableView to determine how many cells to create for that particular section.
|
||||
/// </summary>
|
||||
public override nint RowsInSection (UITableView tableview, nint section)
|
||||
{
|
||||
return TableItems.Length;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called by the TableView to get the actual UITableViewCell to render for the particular row
|
||||
/// </summary>
|
||||
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath)
|
||||
{
|
||||
// request a recycled cell to save memory
|
||||
UITableViewCell cell = tableView.DequeueReusableCell (CellIdentifier);
|
||||
string item = TableItems[indexPath.Row];
|
||||
|
||||
//---- if there are no cells to reuse, create a new one
|
||||
if (cell == null)
|
||||
{ cell = new UITableViewCell (UITableViewCellStyle.Default, CellIdentifier); }
|
||||
|
||||
cell.TextLabel.Text = item;
|
||||
//cell.SeparatorInset = new UIEdgeInsets (50, 50, 50, 50);
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
||||
public override string TitleForHeader (UITableView tableView, nint section)
|
||||
{
|
||||
return " ";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
using System;
|
||||
|
||||
using UIKit;
|
||||
using System.Collections.Generic;
|
||||
using Foundation;
|
||||
|
||||
namespace PopulatingATable
|
||||
{
|
||||
public partial class ViewController : UIViewController
|
||||
{
|
||||
UITableView table;
|
||||
|
||||
public ViewController (IntPtr handle) : base (handle)
|
||||
{
|
||||
}
|
||||
|
||||
public override void ViewDidLoad ()
|
||||
{
|
||||
base.ViewDidLoad ();
|
||||
|
||||
table = new UITableView (View.Bounds);
|
||||
table.AutoresizingMask = UIViewAutoresizing.All;
|
||||
CreateTableItems();
|
||||
Add (table);
|
||||
|
||||
// TableViewDelegate tableDelegate = new TableViewDelegate (this);
|
||||
//
|
||||
// table.Delegate = tableDelegate;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void CreateTableItems ()
|
||||
{
|
||||
List<string> tableItems = new List<string> ();
|
||||
tableItems.Add ("Vegetables");
|
||||
tableItems.Add ("Fruits");
|
||||
tableItems.Add ("Flower Buds");
|
||||
tableItems.Add ("Legumes");
|
||||
tableItems.Add ("Bulbs");
|
||||
tableItems.Add ("Tubers");
|
||||
table.Source = new TableSource(tableItems.ToArray());
|
||||
}
|
||||
|
||||
public override void DidReceiveMemoryWarning ()
|
||||
{
|
||||
base.DidReceiveMemoryWarning ();
|
||||
// Release any cached data, images, etc that aren't in use.
|
||||
}
|
||||
|
||||
// class TableViewDelegate : NSObject, IUITableViewDelegate{
|
||||
//
|
||||
// ViewController parent ;
|
||||
//
|
||||
// public TableViewDelegate(ViewController parent){
|
||||
// this.parent = parent;
|
||||
// }
|
||||
//
|
||||
// [Export ("tableView:didSelectRowAtIndexPath:")]
|
||||
// public void RowSelected (UITableView tableView, NSIndexPath indexPath)
|
||||
// {
|
||||
// var tableSource = (TableSource)parent.table.Source;
|
||||
// UIAlertController okAlertController = UIAlertController.Create ("Row Selected", tableSource.GetTableItem(indexPath), UIAlertControllerStyle.Alert);
|
||||
// okAlertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null));
|
||||
// parent.PresentViewController (okAlertController, true, null);
|
||||
// tableView.DeselectRow (indexPath, true);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
21
WorkingWithTables/Part 2 - Populating a table with data/PopulatingATable/PopulatingATable/ViewController.designer.cs
сгенерированный
Normal file
|
@ -0,0 +1,21 @@
|
|||
// WARNING
|
||||
//
|
||||
// This file has been generated automatically by Xamarin Studio from the outlets and
|
||||
// actions declared in your storyboard file.
|
||||
// Manual changes to this file will not be maintained.
|
||||
//
|
||||
using Foundation;
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using UIKit;
|
||||
|
||||
namespace PopulatingATable
|
||||
{
|
||||
[Register ("ViewController")]
|
||||
partial class ViewController
|
||||
{
|
||||
void ReleaseDesignerOutlets ()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
IP: 127.0.0.1
|
||||
Port: 10000
|
|
@ -0,0 +1 @@
|
|||
APPL????
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>genre</key>
|
||||
<string>Application</string>
|
||||
<key>bundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>itemName</key>
|
||||
<string>PopulatingATable</string>
|
||||
<key>kind</key>
|
||||
<string>software</string>
|
||||
<key>playlistName</key>
|
||||
<string>PopulatingATable</string>
|
||||
<key>softwareIconNeedsShine</key>
|
||||
<true/>
|
||||
<key>softwareVersionBundleId</key>
|
||||
<string>com.companyname.populatingatable</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
|
||||
<plist version=\"1.0\">
|
||||
<dict>
|
||||
<key>NewRefCount</key>
|
||||
<string>true</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,24 @@
|
|||
/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/PopulatingATable/PopulatingATable/obj/iPhoneSimulator/Debug/Xamarin.iOS,Version=v1.0.AssemblyAttribute.cs
|
||||
/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/PopulatingATable/PopulatingATable/obj/iPhoneSimulator/Debug/ibtool/LaunchScreen.nib
|
||||
/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/PopulatingATable/PopulatingATable/obj/iPhoneSimulator/Debug/ibtool/Main.storyboardc/BYZ-38-t0r-view-8bC-Xf-vdC.nib
|
||||
/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/PopulatingATable/PopulatingATable/obj/iPhoneSimulator/Debug/ibtool/Main.storyboardc/Info.plist
|
||||
/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/PopulatingATable/PopulatingATable/obj/iPhoneSimulator/Debug/ibtool/Main.storyboardc/UIViewController-BYZ-38-t0r.nib
|
||||
/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/PopulatingATable/PopulatingATable/obj/iPhoneSimulator/Debug/actool/partial-info.plist
|
||||
/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/PopulatingATable/PopulatingATable/obj/iPhoneSimulator/Debug/actool/asset-manifest.plist
|
||||
/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/PopulatingATable/PopulatingATable/obj/iPhoneSimulator/Debug/
|
||||
/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/PopulatingATable/PopulatingATable/bin/iPhoneSimulator/Debug/PopulatingATable.exe.mdb
|
||||
/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/PopulatingATable/PopulatingATable/bin/iPhoneSimulator/Debug/PopulatingATable.exe
|
||||
/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/PopulatingATable/PopulatingATable/obj/iPhoneSimulator/Debug/PopulatingATable.exe
|
||||
/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/PopulatingATable/PopulatingATable/obj/iPhoneSimulator/Debug/PopulatingATable.exe.mdb
|
||||
/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/Populating a table with data/PopulatingATable/PopulatingATable/obj/iPhoneSimulator/Debug/Xamarin.iOS,Version=v1.0.AssemblyAttribute.cs
|
||||
/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/Populating a table with data/PopulatingATable/PopulatingATable/obj/iPhoneSimulator/Debug/ibtool/LaunchScreen.nib
|
||||
/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/Populating a table with data/PopulatingATable/PopulatingATable/obj/iPhoneSimulator/Debug/ibtool/Main.storyboardc/BYZ-38-t0r-view-8bC-Xf-vdC.nib
|
||||
/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/Populating a table with data/PopulatingATable/PopulatingATable/obj/iPhoneSimulator/Debug/ibtool/Main.storyboardc/Info.plist
|
||||
/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/Populating a table with data/PopulatingATable/PopulatingATable/obj/iPhoneSimulator/Debug/ibtool/Main.storyboardc/UIViewController-BYZ-38-t0r.nib
|
||||
/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/Populating a table with data/PopulatingATable/PopulatingATable/obj/iPhoneSimulator/Debug/actool/partial-info.plist
|
||||
/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/Populating a table with data/PopulatingATable/PopulatingATable/obj/iPhoneSimulator/Debug/actool/asset-manifest.plist
|
||||
/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/Populating a table with data/PopulatingATable/PopulatingATable/obj/iPhoneSimulator/Debug/
|
||||
/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/Populating a table with data/PopulatingATable/PopulatingATable/bin/iPhoneSimulator/Debug/PopulatingATable.exe.mdb
|
||||
/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/Populating a table with data/PopulatingATable/PopulatingATable/bin/iPhoneSimulator/Debug/PopulatingATable.exe
|
||||
/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/Populating a table with data/PopulatingATable/PopulatingATable/obj/iPhoneSimulator/Debug/PopulatingATable.exe
|
||||
/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/Populating a table with data/PopulatingATable/PopulatingATable/obj/iPhoneSimulator/Debug/PopulatingATable.exe.mdb
|
|
@ -0,0 +1,2 @@
|
|||
// <autogenerated />
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute("Xamarin.iOS,Version=v1.0", FrameworkDisplayName = "")]
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.actool.compilation-results</key>
|
||||
<dict>
|
||||
<key>output-files</key>
|
||||
<array>
|
||||
<string>/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/Populating a table with data/PopulatingATable/PopulatingATable/obj/iPhoneSimulator/Debug/actool/partial-info.plist</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict/>
|
||||
</plist>
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.ibtool.document.errors</key>
|
||||
<dict/>
|
||||
<key>com.apple.ibtool.document.notices</key>
|
||||
<dict/>
|
||||
<key>com.apple.ibtool.document.warnings</key>
|
||||
<dict/>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,32 @@
|
|||
# Version: 8.10.1.74 (6916d0e)
|
||||
# [first argument, ignore] # /Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/Populating a table with data/PopulatingATable/PopulatingATable/mtouch.exe
|
||||
/Library/Frameworks/Xamarin.iOS.framework/Versions/8.10.1.74/bin/mtouch \
|
||||
--cache \
|
||||
"/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/Populating a table with data/PopulatingATable/PopulatingATable/obj/iPhoneSimulator/Debug/mtouch-cache" \
|
||||
--sim \
|
||||
"/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/Populating a table with data/PopulatingATable/PopulatingATable/bin/iPhoneSimulator/Debug/PopulatingATable.app" \
|
||||
--executable \
|
||||
PopulatingATable \
|
||||
--debug \
|
||||
--nolink \
|
||||
--sdkroot \
|
||||
/Applications/Xcode.app/Contents/Developer \
|
||||
--sdk \
|
||||
8.3 \
|
||||
--targetver \
|
||||
8.3 \
|
||||
--abi=i386 \
|
||||
--symbollist \
|
||||
"/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/Populating a table with data/PopulatingATable/PopulatingATable/obj/iPhoneSimulator/Debug/mtouch-symbols.list" \
|
||||
--dsym=no \
|
||||
-r \
|
||||
/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.dll \
|
||||
-r \
|
||||
/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Xml.dll \
|
||||
-r \
|
||||
/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Xamarin.iOS.dll \
|
||||
-r \
|
||||
/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Core.dll \
|
||||
-r \
|
||||
/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/mscorlib.dll \
|
||||
"/Users/amyburns/Documents/Xamarin/Repos/documentation/guides/ios/user_interface/tables/index/Resources/Populating a table with data/PopulatingATable/PopulatingATable/bin/iPhoneSimulator/Debug//PopulatingATable.exe" \
|
|
@ -0,0 +1,38 @@
|
|||
using System;
|
||||
using UIKit;
|
||||
using Foundation;
|
||||
|
||||
namespace BasicTable {
|
||||
public class Application {
|
||||
public static void Main (string[] args)
|
||||
{
|
||||
try {
|
||||
UIApplication.Main (args, null, "AppDelegate");
|
||||
} catch (Exception e) {
|
||||
Console.WriteLine (e.ToString ());
|
||||
}
|
||||
}
|
||||
}
|
||||
[Register("AppDelegate")]
|
||||
public class AppDelegate : UIApplicationDelegate
|
||||
{
|
||||
protected UIWindow window;
|
||||
protected HomeScreen iPhoneHome;
|
||||
|
||||
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
|
||||
{
|
||||
window = new UIWindow (UIScreen.MainScreen.Bounds);
|
||||
window.MakeKeyAndVisible ();
|
||||
|
||||
iPhoneHome = new HomeScreen();
|
||||
iPhoneHome.View.Frame = new CoreGraphics.CGRect(0
|
||||
, UIApplication.SharedApplication.StatusBarFrame.Height
|
||||
, UIScreen.MainScreen.ApplicationFrame.Width
|
||||
, UIScreen.MainScreen.ApplicationFrame.Height);
|
||||
|
||||
window.AddSubview (iPhoneHome.View);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,118 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{15D8E98D-D803-4CCC-906F-0960D31DD333}</ProjectGuid>
|
||||
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>BasicTable</RootNamespace>
|
||||
<AssemblyName>Example_EditableTable</AssemblyName>
|
||||
<TargetFrameworkIdentifier>Xamarin.iOS</TargetFrameworkIdentifier>
|
||||
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchI18n>
|
||||
</MtouchI18n>
|
||||
<MtouchUseArmv7>false</MtouchUseArmv7>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchI18n>
|
||||
</MtouchI18n>
|
||||
<MtouchUseArmv7>false</MtouchUseArmv7>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhone\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchI18n>
|
||||
</MtouchI18n>
|
||||
<MtouchUseArmv7>false</MtouchUseArmv7>
|
||||
<IpaPackageName>
|
||||
</IpaPackageName>
|
||||
<MtouchArch>ARMv7</MtouchArch>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhone\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchI18n>
|
||||
</MtouchI18n>
|
||||
<MtouchUseArmv7>false</MtouchUseArmv7>
|
||||
<MtouchArch>ARMv7, ARM64</MtouchArch>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Xamarin.iOS" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AppDelegate.cs" />
|
||||
<Compile Include="HomeScreen.cs" />
|
||||
<Compile Include="Code\TableSource.cs" />
|
||||
<Compile Include="Code\TableItem.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Images\" />
|
||||
<Folder Include="Images\Icons\" />
|
||||
<Folder Include="Code\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Images\Icons\29_icon.png" />
|
||||
<Content Include="Images\Icons\50_icon.png" />
|
||||
<Content Include="Images\Icons\57_icon.png" />
|
||||
<Content Include="Images\Icons\58_icon.png" />
|
||||
<Content Include="Images\Icons\72_icon.png" />
|
||||
<Content Include="Images\Icons\114_icon.png" />
|
||||
<Content Include="Images\Bulbs.jpg" />
|
||||
<Content Include="Images\Flower Buds.jpg" />
|
||||
<Content Include="Images\Fruits.jpg" />
|
||||
<Content Include="Images\Legumes.jpg" />
|
||||
<Content Include="Images\Tubers.jpg" />
|
||||
<Content Include="Images\Vegetables.jpg" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Info.plist" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<ITunesArtwork Include="Images\Icons\512_icon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\Icon-60%402x.png" />
|
||||
<BundleResource Include="Resources\Icon%402x.png" />
|
||||
<BundleResource Include="Resources\Icon.png" />
|
||||
<BundleResource Include="Resources\Default-568h%402x.png" />
|
||||
</ItemGroup>
|
||||
</Project>
|