UIViewController StyleTransactionsScreen(RootElement arg) { var dvc = new DialogViewController(UITableViewStyle.Plain, arg, true); dvc.LoadView(); dvc.Root.TableView.SeparatorColor = UIColor.FromPatternImage(Resources.CellSeparator); dvc.Root.TableView.BackgroundView = new UIImageView(UIImage.FromBundle("paper.png")); return(dvc); }
public override void OnEditingStarted(UISearchBar searchBar) { if (_searchController == null) { _searchController = new DialogViewController(UITableViewStyle.Plain, null); _searchController.LoadView(); _searchController.TableView.TableFooterView = new UIView(new RectangleF(0, 0, 0, 0)); } searchBar.ShowsCancelButton = true; _container.TableView.ScrollRectToVisible(new RectangleF(0, 0, 1, 1), false); _container.NavigationController.SetNavigationBarHidden(true, true); _container.IsSearching = true; _container.TableView.ScrollEnabled = false; if (_searchController.Root != null && _searchController.Root.Count > 0 && _searchController.Root[0].Count > 0) { _searchController.View.BackgroundColor = UIColor.White; _searchController.TableView.ScrollEnabled = true; } else { _searchController.View.BackgroundColor = NoItemColor; _searchController.TableView.ScrollEnabled = false; } _searchElements = new List <ElementContainer>(); //Grab all the elements that we could search trhough foreach (var s in _container.Root) { foreach (var e in s.Elements) { _searchElements.Add(new ElementContainer { Element = e, Parent = e.Parent }); } } if (!_container.ChildViewControllers.Contains(_searchController)) { _searchController.View.Frame = new RectangleF(_container.TableView.Bounds.X, 44f, _container.TableView.Bounds.Width, _container.TableView.Bounds.Height - 44f); _container.AddChildViewController(_searchController); _container.View.AddSubview(_searchController.View); } }