11

我正在使用SignaturePadXamarin.Forms即使在基本的硬件设备上也能正常工作,但我只用一台设备就遇到了奇怪的行为:三星 Galaxy Tab E 7.0 3G SM-T116 平板电脑。

问题是 SignaturePad 视图上的笔划仅在从屏幕上释放触摸时才显示。例如,如果我慢慢地画一条长长的水平线,整个笔划是不可见的,直到我释放屏幕触摸。

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

非常感谢。

4

2 回答 2

4

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

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 中的布局:

<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>

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.

于 2017-10-10T14:55:28.460 回答
1

Question is a bit old now but this has been resolved in 3.0.0.

I had a similar issue on a Galaxy Tab A which was fixed by upgrading.

于 2019-04-22T23:14:33.377 回答