-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed dropdown when textfield is placed in a UITableView #30
Conversation
Fixed dropdown when textfield is placed in a UITableView
This merge causes problems for my code. I think it might have to do with the fact that the root view is UILayoutContainerView. I think the solution referenced in #7 might be more appropriate (although somewhat inelegant). @mikumi Do you think you could explain what positioning problems you were still having in comment #7 (comment)? Maybe a different solution could be found. |
The positioning-problem I was having was that the autocompletion-Table was placed inside the textfield. Actually, the current version is doing that again I think (something changed after my merge) and I am using a modified version for myself locally (haven't committed these changes yet, sorry). |
I think mikumi's original change had caused another bug, and in the process Keep in mind the drop down table is supposed to appear slightly beneath the On Fri, Jul 18, 2014 at 12:58 AM, mikumi notifications@github.com wrote:
|
My problem is that the rootView of from the window is not the superview of the autocompleteTextView. So when the autoCompleteTableView is added, it is added to UILayoutContainerView and cant be place below the textview. I edited the demo code in my fork to show my issue. It can be switched between the two placement styles with a #define |
I just wanted to report that this change causes issues for me. When I scroll my tableview the autocomplete view doesn't scroll with the table and just stays where it is. Before this, it works perfectly. I don't know much more at this point, but if I find anything I'll post it. Maybe someone has had a similar experience. |
@kurtzmarc The problem you are having is probably the fact that the autocompleteview is not being added to the tableview (/associated scrollview) with this fix. The sample project doesn't really show the issue off very well. If you look at my branch and edit the BROKEN macro you can see what is happening. |
It seems like your BROKEN macro reverts the changes from this revision to get it to work again. Is that the best workaround? Is this a known issue? |
Well its kind of a hard problem to solve because you want the autocomplete cells to work when they are in another smaller table view cell. To fix that people tried adding view to the root view in this fix. The problem with that is the root view is probably not the table view and in my experience it has been UILayoutContainerView which is a private-ish class we know little about. There is another fix referenced in #7 that talks about creating a property of a target view to add the autocompletetableview to. The fix I think would be best is using the old superview functionality since that is appropriate for most situations and adding an optional property to specify the target view when that doesn't work. I haven't submitted a pull request with the fix because it was inelegant and was hoping someone else might have a better idea. |
The dropdown will be attached to the rootview instead of the superview. That way dropdown items can be selected even when placed in a UITableView. Positioning in a UITableView has also been fixed.