1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-16 16:23:29 +00:00

Setup picker tableview cell to mimic xamarin forms picker

This commit is contained in:
Kyle Spearrin
2016-07-12 22:38:36 -04:00
parent 822a14e56c
commit 4723e6a101
2 changed files with 125 additions and 17 deletions

View File

@@ -33,6 +33,7 @@ namespace Bit.iOS.Extension
public UITableViewCell GeneratePasswordCell { get; set; } = new UITableViewCell(UITableViewCellStyle.Subtitle, "GeneratePasswordCell");
public SwitchTableViewCell FavoriteCell { get; set; } = new SwitchTableViewCell("Favorite");
public FormEntryTableViewCell NotesCell { get; set; } = new FormEntryTableViewCell(useTextView: true, height: 90);
public PickerTableViewCell FolderCell { get; set; } = new PickerTableViewCell(AppResources.Folder);
public override void ViewWillAppear(bool animated)
{
@@ -87,6 +88,9 @@ namespace Bit.iOS.Extension
GeneratePasswordCell.TextLabel.Text = "Generate Password";
GeneratePasswordCell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
FolderCell.Items = new List<string> { "Folder 1", "Folder 2" };
FolderCell.SelectedIndex = 1;
TableView.RowHeight = UITableView.AutomaticDimension;
TableView.EstimatedRowHeight = 70;
TableView.Source = new TableSource(this);
@@ -195,7 +199,11 @@ namespace Bit.iOS.Extension
}
else if(indexPath.Section == 1)
{
if(indexPath.Row == 1)
if(indexPath.Row == 0)
{
return _controller.FolderCell;
}
else if(indexPath.Row == 1)
{
return _controller.FavoriteCell;
}