を取得します私は内部に4つのUITextFieldsを持つカスタムUITableViewCellを生成します。表の列は、この(SQLiteの)は、私は可能な解決策のための全体Googleのデータベースを検索したが、私はまだこの問題にこだわって:)</p> <p>基本的に、私はデータベースのテーブルに12行を持って誓うカスタム内側UITextFieldsからの値のUITableViewCell
EntryFieldID NUMBER
Description TEXT
FieldType TEXT
のように見える今、私は、各UITableViewCell
タグはので、私は簡単に別のテーブルに格納するために戻って後で参照することができます上記EntryFieldID
になりたいです。そのテーブルはこのように見えます。
OrderID NUMBER
EntryFieldID NUMBER
Value1 TEXT
Value2 TEXT
Value3 TEXT
Value4 TEXT
4値*フィールドは、各UIViewCell
内側にある4 UITextFields
あります。
がうまくいけば、これはこれまでに理にかなって:)今
私TableViewSource内部の私はこのコードを持っている:
protected List<InfoCaptureTableViewGroup> _tableItems;
protected string _customCellIdentifier = "InfoCaptureField";
protected Dictionary<int, InfoCaptureTableViewCell> _cellControllers = new Dictionary<int, InfoCaptureTableViewCell>();
public InfoCaptureTableSource (List<InfoCaptureTableViewGroup> items)
{
this._tableItems = items;
}
/// <summary>
/// Called by the TableView to determine how many sections(groups) there are.
/// </summary>
public override int NumberOfSections (UITableView tableView)
{
return this._tableItems.Count;
}
/// <summary>
/// Called by the TableView to determine how many cells to create for that particular section.
/// </summary>
public override int RowsInSection (UITableView tableview, int section)
{
return this._tableItems[section].Items.Count;
}
/// <summary>
/// Called by the TableView to retrieve the header text for the particular section(group)
/// </summary>
public override string TitleForHeader (UITableView tableView, int section)
{
return this._tableItems[section].Name;
}
/// <summary>
/// Called by the TableView to retrieve the footer text for the particular section(group)
/// </summary>
public override string TitleForFooter (UITableView tableView, int section)
{
return this._tableItems[section].Footer;
}
/// <summary>
/// Called by the TableView to retreive the height of the row for the particular section and row
/// </summary>
public override float GetHeightForRow (UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
{
return 44f;
}
public override UITableViewCell GetCell (UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
{
// is there a way to NOT reuse cells? There's only ever going to be 12 of them
UITableViewCell cell = tableView.DequeueReusableCell (this._customCellIdentifier);
InfoCaptureTableViewCell customCellController = null;
InfoCaptureField item = this._tableItems[indexPath.Section].Items[indexPath.Row];
//---- if there are no cells to reuse, create a new one
if (cell == null)
{
customCellController = new InfoCaptureTableViewCell();
// retrieve the cell from our custom cell controller
cell = customCellController.Cell;
// disable selection
cell.SelectionStyle = UITableViewCellSelectionStyle.None;
// This is where I'd like to use the EntryFieldID
cell.Tag = Environment.TickCount;
// store our controller with the unique ID we gave our cell
this._cellControllers.Add (cell.Tag, customCellController);
}
else
{
// retrieve our controller via it's unique ID
customCellController = this._cellControllers[cell.Tag];
}
//---- return the custom cell
return cell;
}
上記のコードは、実際に私にはあまり意味がありません、それはMonoTouchの例からコピーされました。私はセルが再利用されることを理解していますが、実際にはこれを避けたいので、カスタムセルのTagプロパティにEntryFieldIDを使用することができ、UITableViewのすべての行をループすることができます。 。
誰かが私の現在のアプローチについて、それが実現可能であろうとなかろうと、それを全面的に再実装することを検討する必要があるかどうかについて、いくつか明示することができれば。
あなたはGoogleのデータベースにアクセスできますか?私はあなたを羨ましい;) –
私たちはすべて@ケットラーをしています:) – Marko