WebView 컨트롤러의 각 요청에 일부 헤더를 추가하려고합니다. 사용자 지정 웹 렌더러를 사용하여 헤더를 추가하고 있습니다. iOS에서는 잘 작동하지만 Android에 렌더러 클래스를 추가하면 예외가 발생합니다.Xamarin이 Android에서 사용자 정의 WebViewRender를 형성합니다.
이 코드는 PCL에서이
처럼 보이는, 내가 어떤 사용자 지정 속성 안드로이드 프로젝트에서
public class AuthWebView : WebView
{
public static readonly BindableProperty UrlProperty =
BindableProperty.Create("Url", typeof(string), typeof(AuthWebView), default(string));
public string Url
{
get => (string)GetValue(UrlProperty);
set => SetValue(UrlProperty, value);
}
public string UserToken { get; set; }
}
를 추가 할 웹보기 컨트롤을 상속, 난 그냥
을 다음과 같이 빈 렌더링 생성
[assembly: ExportRenderer(typeof(AuthWebView), typeof(TestRenderer))]
namespace Reshare.Droid
{
public class TestRenderer : WebViewRenderer
{
}
}
AuthWebView 컨트롤이 포함 된 페이지를 시작할 때마다 일반적인 예외가 발생했습니다.
,210처리되지 않은 예외 : System.Reflection.TargetInvocationException : 예외가 대상 호출
예외가 발생하는 원인이 될 수 있습니다 내가 여기에 놓친 어떤 일이 있습니까 throw되었습니다?