xamarin.androidにストライプペイメントゲートウェイを統合しようとしていますが、アプリケーションクローズの問題があります。ここで私が試したサンプルコードです。xamarin androidにストライプビューペイメントゲートウェイを統合している間にアプリケーションがクラッシュしました
サンプルコード:
[assembly: ExportRenderer(typeof(PaymentView), typeof(CardInputActivity)]
namespace SampleProject.Droid.PaymentController
public class CardInputActivity(Bundle bundle) : Activity
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.CardInput);
Helper.StripeView = FindViewById<StripeView>(Resource.Id.stripeLayoutOne);
}
CardInput.axml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="20dp">
<Stripe.StripeView
android:id="@+id/stripeView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp" />
</LinearLayout>
これは私が試してみましたコードです。上記の 'CardInPutActivity'はアンドロイドのレンダラークラス、 'CardInputView'はリソースフォルダのレイアウトファイル、 'PaymentView'はビューを含むポータブルクラスです。