XF - SignaturePad show strokes only when the touch ends

前端 未结 2 2218
孤独总比滥情好
孤独总比滥情好 2021-02-20 03:23

I\'m using SignaturePad with Xamarin.Forms and it works fine even on basic hardware devices, but I\'ve struggled with a weird behavior with just one device: Samsung

2条回答
  •  我寻月下人不归
    2021-02-20 03:55

    I've implemented the SignaturePadView in the following way.

    MainActivity.cs:

    protected override void OnCreate(Bundle savedInstanceState)
    {
        base.OnCreate(savedInstanceState);
        // Set our view from the "main" layout resource
        SetContentView(Resource.Layout.Main);
    
        Xamarin.Forms.Forms.Init(this.ApplicationContext, savedInstanceState);
    
        signatureView = new SignaturePadView(this);
        signatureView.StrokeWidth = 4;
    
        LinearLayout signatureLayout = (LinearLayout)FindViewById(Resource.Id.signatureLayout);
        signatureLayout.AddView(signatureView);
    
        Button btnSave = FindViewById

    Here is the layout in my Main.axml:

    
        
    

    I just have a hunch that you are creating a new SignaturePadView object or adding it to the layout after some event happens by the user.

提交回复
热议问题