建立相對應的cell Class ```swift import Foundation import UiKit public class CustomerCell:UITableViewCell{ override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
UIStoryboard.FromName ("MainStoryboard", null).InstantiateViewController (viewcontroller_name) as UIViewController;
IOS頁面間的流程靠的是對NavigationController的操作,以下是針對NavigationController的一些設定 ```csharp public override void ViewDidLoad () { //edit control in viewdidload //NavigationBar的背景色 NavigationController.NavigationBar.BarTintColor = new UIColor(0.58f,0.761f,0.231f,1f);
TableViewController的製作方式 ```csharp //製作TableSource的Class public class TableSource : UITableViewSource { string cellIdentifier = “OptionsTableCell”; public List TABLE_ITEMS{ get; set;} //每列資料 public event EventHandler Cell_RowSelected;//給外層cell click事件
public TableSource ()
{
TABLE_ITEMS = new List<tablecell> ();
}
public override nint RowsInSection (UITableView tableview, nint section)
{
return TABLE_ITEMS.Count;
}
public override UITableViewCell GetCell (UITableView tableView, Foundation.NSIndexPath indexPath)
{
UITableViewCell cell = tableView.DequeueReusableCell (cellIdentifier);
//if there are no cells to reuse , cerate a new one
if (cell == null) cell = new UITableViewCell (UITableViewCellStyle.Default, cellIdentifier);
cell.TextLabel.Text = TABLE_ITEMS [indexPath.Row].TITLE;
cell.TextLabel.Font = UIFont.SystemFontOfSize(15f);
cell.TextLabel.TextColor = new UIColor (0.453f, 0.453f, 0.453f, 1);
cell.ImageView.Image = UIImage.FromBundle (TABLE_ITEMS[indexPath.Row].IMAGE); //cell front Image
cell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
return cell;
}
public override void RowSelected (UITableView tableView, Foundation.NSIndexPath indexPath)