This is a migrated thread and some comments may be shown as answers.

AutoCompleteTextView in a UITableViewCell

5 Answers 58 Views
AutoCompleteTextView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Miguel
Top achievements
Rank 1
Miguel asked on 15 Apr 2016, 01:55 PM

Is there any way to add an AutoCompleteTextView in a UITableViewCell in a way that when suggestions view is displayed is added on the top view stack (hidding other UITableViewCells of the table?

Any sample app were I could start working with?

5 Answers, 1 is accepted

Sort by
0
Accepted
Sophi
Telerik team
answered on 20 Apr 2016, 04:54 PM
Hi Miguel,

The suggestionView of the TKAutoCompleteTextView can be attached to any visual element in your view hierarchy not only to the autocomplete itself. For example you can attach it as a child to the cell itself or the whole tableview.
You can consider applying this approach to your project.
You should set the suggestionViewOutOfFrame and then set new frame and parent to the suggestionView. Consider the following snippet from the customization example.
  self.autocomplete.suggestionViewOutOfFrame = YES;
_listView = (TKListView*)self.autocomplete.suggestionView;
     
    _listView.frame = CGRectMake(10, self.view.bounds.origin.y + 50, self.view.bounds.size.width - 20, self.view.bounds.size.height - (15 + self.autocomplete.bounds.size.height));
    _listView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight ;
    [_listView removeFromSuperview];
    [self.view addSubview:_listView];

For guidance you can check out our sdk examples, here is link to our autocomplete customization example.
If you have any further questions, do not hesitate to contact us.

Regards,
Sophi
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Ryan
Top achievements
Rank 1
answered on 11 Jan 2017, 07:30 PM
I want to attach TKAutocompleteTextView's suggestionView to the UITableView cell but make it appear as if it is attached to the suggestionView, completely lined up with it as it is by default. How can I achieve this? I also want it to disappear when you scroll the table as is the default behavior (I currently have it attached to the autocomplete by default but it does not appear always since there is not a lot of room in the cell's content view for the suggestion view).
0
Ryan
Top achievements
Rank 1
answered on 11 Jan 2017, 07:35 PM
or rather placing it on top of the UITableView itself right below the autocomplete so it appears attached to it like default.
0
Ryan
Top achievements
Rank 1
answered on 11 Jan 2017, 10:35 PM
Ideally I would like it to just work out of the box without me having to move the suggestionView from being attached to the autocomplete control within the cell to being attached to the top most view. Any way to get that working so that it always shows? My best guess as to why it does not show sometimes and shows sometimes is that the table cell doesn't have enough space to show it or there is a bug with the telerik controls.
0
Sophi
Telerik team
answered on 16 Jan 2017, 01:02 PM
Hello Ryan,

It looks to me like the cell's height is not enough to show the suggestionView.
If the cell has height less than the autocomplete field plus the suggestion view height, something will appears cut.
In order to verify the scenario, could you please send us a sample project so we can examine it and suggest proper solution according to it.

Looking forward to hearing from you.

Regards,
Sophi
Telerik by Progress
Want to build beautiful Android apps as well? Check out UI for Android which enables the same set of scenarios, allowing you to create the same great app experience on both iOS and Android.
Tags
AutoCompleteTextView
Asked by
Miguel
Top achievements
Rank 1
Answers by
Sophi
Telerik team
Ryan
Top achievements
Rank 1
Share this question
or