XF-SignaturePad仅在触摸结束时显示笔触 [英] XF - SignaturePad show strokes only when the touch ends

查看:112
本文介绍了XF-SignaturePad仅在触摸结束时显示笔触的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将 SignaturePad Xamarin.Forms一起使用,即使在基本硬件设备上也可以正常使用,但是我只用一种设备就无法解决奇怪的问题:三星Galaxy Tab E 7.0 3G SM-T116平板电脑.

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 Galaxy Tab E 7.0 3G SM-T116 Tablet.

问题在于,只有从屏幕上释放触摸时,才显示SignaturePad视图上的笔划.例如,如果我缓慢地制作一条较长的水平线,那么直到我松开屏幕触摸时,整个笔划才是看不见的.

The problem is that the strokes on SignaturePad view are shown only when the touch is released from the screen. For example, if I make a long horizontal side to side line slowly, the whole stroke is invisible until I release the screen touch.

有人已经有类似情况吗?我该如何解决?

Anyone already had a similar situation? How can I workaround it?

非常感谢.

推荐答案

我已经通过以下方式实现了SignaturePadView.

I've implemented the SignaturePadView in the following way.

MainActivity.cs:

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<Button>(Resource.Id.btnSave);
    btnSave.Click += (sender, e) =>
    {
        SaveInfo();
    };

}

这是我Main.axml中的布局:

Here is the layout in my Main.axml:

<LinearLayout
            android:orientation="vertical"
            android:minWidth="25px"
            android:minHeight="25px"
            android:layout_width="fill_parent"
            android:layout_height="225.0dp"
            android:layout_weight="1"
            android:id="@+id/signatureLayout"
            android:background="@drawable/logosimg"
            android:gravity="center|bottom" />
    </LinearLayout>

我只是有一种预感,您是在用户发生某些事件之后创建一个新的SignaturePadView对象或将其添加到布局中.

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.

这篇关于XF-SignaturePad仅在触摸结束时显示笔触的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆