0
我想將條紋支付網關集成到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'是android中的渲染器類,'CardInputView'是資源文件夾中的佈局文件,'PaymentView'是可移植類包含視圖。