Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Delivering touch events to a view outside the bounds of its parent view. [iOS]

$
0
0

I'm working on popup UITableView, that is shown above parent UITextField. And the problem is my tableView is not clickable at all except Vegetables item, that is placed right above the parent view.
I tried to solve that in different ways. For instance, I wanted to catch Touch event in the parent textField, but event wasn't firing.
I met in web some advices regarding ObjectiveC hitTest method usage, but I don't know how to apply that in Xamarin project.
Does anyone know how to solve it?

Here is my custom renderer:

`protected override void OnElementChanged(ElementChangedEventArgs e)
{
base.OnElementChanged(e);

        if (e.OldElement == null)
        {

            var nativeTextField = (UITextField)Control;
            nativeTextField.BorderStyle = UITextBorderStyle.None;
            nativeTextField.ClipsToBounds = false;
            nativeTextField.AutoresizingMask = UIViewAutoresizing.All;


            UITableView table = new UITableView(new RectangleF(200, -40, 300, 300));
            table.ExclusiveTouch = true;
            table.UserInteractionEnabled = true;
            string[] tableItems = new string[] {"Vegetables","Fruits","Flower Buds","Legumes","Bulbs","Tubers"};
            table.Source = new TableSource(tableItems);

            nativeTextField.Add(table);
            nativeTextField.BringSubviewToFront(button);

...`


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>