Skip to content

Instantly share code, notes, and snippets.

@hartez
Last active October 4, 2017 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hartez/646fe8d96ab037991b6235f3d224e6c9 to your computer and use it in GitHub Desktop.
Save hartez/646fe8d96ab037991b6235f3d224e6c9 to your computer and use it in GitHub Desktop.
View accepts input after translation
public class TranslatePage : ContentPage
{
public TranslatePage()
{
var layout = new RelativeLayout();
double viewSize = 100;
var box = new Entry
{
HeightRequest = viewSize,
WidthRequest = viewSize,
Placeholder = "entry",
};
layout.Children.Add(box,
Constraint.RelativeToParent(parent => -110),
Constraint.RelativeToParent(parent => - 110),
Constraint.Constant(viewSize), Constraint.Constant(viewSize));
Content = layout;
var startGesture = new TapGestureRecognizer
{
Command = new Command(async () =>
{
await box.TranslateTo(200, 200);
})
};
layout.GestureRecognizers.Add(startGesture);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment