Я делаю простое приложение, которое включает в UITableView с пользовательской Cells, я прочитал этот учебник http://www.arcticmill.com/2012/05/uitableview-with-custom-uitableviewcell.html Все работает как шарм, но я не знаю, как добавить UITableView внутри UIView или UIScrollView, поэтому таблица не использует весь экран.UITableView внутри UIView MonoTouch
using System;
using MonoTouch.UIKit;
using System.Collections.Generic;
using MonoTouch.Foundation;
using MonoTouch.ObjCRuntime;
namespace CustomUITableViewCellSample
{
public class ListSource : UITableViewSource
{
private List<string> _testData = new List<string>();
public ListSource()
{
_testData.Add ("Green");
_testData.Add ("Red");
_testData.Add ("Blue");
_testData.Add ("Yellow");
_testData.Add ("Purple");
_testData.Add ("Orange");
}
public override UITableViewCell GetCell (UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
{
// Reuse a cell if one exists
CustomListCell cell = tableView.DequeueReusableCell ("ColorCell") as CustomListCell;
if (cell == null) {
// We have to allocate a cell
var views = NSBundle.MainBundle.LoadNib ("CustomListCell", tableView, null);
cell = Runtime.GetNSObject (views.ValueAt (0)) as CustomListCell;
}
// This cell has been used before, so we need to update it's data
cell.UpdateWithData (_testData [indexPath.Row]);
return cell;
}
public override int RowsInSection (UITableView tableview, int section)
{
return _testData.Count;
}
}
}
Как я могу видеть, ListSource наследует от UITableViewSource, но я действительно не имеют понятия о том, как добавить его в другой Scrollview