휴대용 Xamarin 양식 프로젝트를 사용하고 있습니다.형식의 개체가 대상 형식 'Xamarin.Forms.ContentView'와 일치하지 않습니다.
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Project1.Views.WebView1">
<ContentView.Content>
</ContentView.Content>
</ContentPage>
xaml.cs : 내가 디버깅 할 때 내 페이지
XAML을이 오류가
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace Proje1.Views
{
public partial class WebView1 : ContentPage
{
public WebView1()
{
InitializeComponent();
Label header = new Label
{
Text = "WebView",
FontSize = 20,
FontAttributes = FontAttributes.Bold,
HorizontalOptions = LayoutOptions.Center
};
WebView wView = new WebView
{
Source = new UrlWebViewSource
{
Url = "https://www.acikakademi.com",
},
VerticalOptions = LayoutOptions.FillAndExpand
};
this.Content = new StackLayout
{
Children =
{
header,
wView
}
};
}
}
}
나는이 문제를 해결하려면 어떻게해야합니까? 당신의 XAML이로 설정 있도록
하지만 ContentView에서 상속 받으면 App.cs.x에서 오류가 발생합니다. App.cs에서 초기 페이지를 어떻게 설정해야합니까? –
그러면 어떤 오류가 발생합니까? 그리고 어떻게 귀하의 페이지를 표시하려고하십니까? –
안녕하세요. 여기에 물어 보았습니다. http://stackoverflow.com/questions/39724234/cannot-implicily-convert-type-to-xamarin-forms-page –