Xamarin UITableView with UIButton or UITextField on iOS 14.2 does not work anymore

Sven Reißenweber 21 Reputation points
2020-12-09T13:48:16.857+00:00

Hello,

does anyone also have the problem that when I display a line in UITableView with UITextField or UITextButton, I can't type or click anything?
The same code base works on 13.xx and below.

A simple example is available here
uitableview-with-uibutton-or-uitextfield-on-ios-14-2-does-not-work-anymore

Please HELP....

Thanks a lot
Sven

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,362 questions
0 comments No comments
{count} votes

Accepted answer
  1. Cole Xia (Shanghai Wicresoft Co,.Ltd.) 6,751 Reputation points
    2020-12-10T06:07:04.717+00:00

    Hello,

    Welcome to Microsoft Q&A!

    The controls should be added on Cell.ContentView instead of Cell itself.

    Cell.ContentView is used to display UI and receive interaction .

    Modify your code as below

       cell.ContentView.AddSubviews(textField, uiButton);  
    

    Refer to https://learn.microsoft.com/en-us/xamarin/ios/user-interface/controls/tables/customizing-table-appearance#creating-custom-cell-layouts

    Thank you.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Sven Reißenweber 21 Reputation points
    2020-12-10T09:14:33.36+00:00

    @Cole Xia (Shanghai Wicresoft Co,.Ltd.) :

    you are my hero!!!!!,

    this was exactly the solution.

    Thanks a lot
    and a beautiful christmas :-)

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.