7

From this link.

false if the element should receive input; true if element should not receive input and should, instead, pass inputs to the element below. Default is false.

What I want is, the Entry field must not be allowed to receive input from user.

InputTransparent=true works well in iOS but doesn't work in Android, it still allows the user to give input.

I tried IsEnabled=false but that changes the look of my Entry field and I don't want that.

Is this some kind of bug?

Akash Amin
  • 2,741
  • 19
  • 38

2 Answers2

0

InputTransparent do not work for Android. I created simply render for StackLayout:

in PCL project:

public class StackLayoutAdd :StackLayout
{
}

in Android project:

[assembly: ExportRenderer(typeof(StackLayoutAdd),   typeof(StackLayoutAddCustom))] 
.....
public class StackLayoutAddCustom : VisualElementRenderer<StackLayout>
{
    public override bool DispatchTouchEvent(MotionEvent e)
    {
        base.DispatchTouchEvent(e);
        return !Element.InputTransparent;
    }
}

I use this in my xaml:

 <StackLayoutAddCustom InputTransparent={Binding IsReadOnly}>
   <Editor />
  ....
 </StackLayoutAddCustom>

This is work for children control.

FetFrumos
  • 5,388
  • 8
  • 60
  • 98
0

based on this question : this fires continuously while touching the screen, so applying custom renderer and override the DispatchTouchEvent

 public override bool DispatchTouchEvent(MotionEvent e)
        {
            if (Element.InputTransparent)
            {
                return false;
            }
            return base.DispatchTouchEvent(e);
        }
Abdullah Tahan
  • 1,963
  • 17
  • 28