Autocomplete for UITextField

christopherpolskachristopherpolska PLUniversity ✭✭✭
edited December 2016 in Xamarin.iOS

Hi,

I have created an autocompleted suggestions for the UITextField. Generally, when user starts to type in the given text field, a UITableView with possible suggestions are shown.

I have two issues:
In one text field it works fine, however in the second it does not show correctly.

Below the text fields I have a big date time picker, clicking in the suggestions table is not always causing to select the suggestion, but the date time picker starts to move - am I missing here some kind of setup that this table should be on top of all the other elements in that view?

This is how I am creating and setting up the UITableView:

_table = new UITableView(); _table.Layer.ZPosition = 1; _table.Layer.BorderWidth = 2.0f; _table.Layer.BorderColor = UIColor.Blue.CGColor; _table.Hidden = true; _parentView.Add(_table);
and the display part:
_table.Source = new SearchTable(matchingElements, _parentViewController); _table.TableFooterView = new UIView(frame: CGRect.Empty); _table.TableHeaderView = new UIView(frame: CGRect.Empty); _table.Frame = new CGRect(_textField.Frame.Left, _textField.Frame.Bottom + 5, _textField.Frame.Width, matchingElements.Count() * 44); _table.Hidden = false;

Thanks! :)

Sign In or Register to comment.