首页 > 解决方案 > Tizen xamarin webview 应用程序在启动时关闭

问题描述

我正在尝试为 tizen TV 创建一个 C# Xamarin 项目每当我包含 WebView 控件时,应用程序都会启动然后立即关闭。

我已经在特权(以及更多)上设置了互联网,但同样的事情一直在发生。但是,当我尝试使用其他控件(标签、按钮)时,它工作得很好。``

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Xamarin.Forms;

namespace CrossTemplate
{
    public class App : Application
    {
        public App()
        {
            var html = new HtmlWebViewSource
            {
                Html = "your html here"
            };
            // The root page of your application
            MainPage = new ContentPage
            {
                Content = new StackLayout
                {
                    Orientation = StackOrientation.Horizontal,
                    Children = {
                        new WebView
                        {
                            WidthRequest = 100,
                            HeightRequest = 100,
                            /* Source = "http://google.com/" Url or pure html same thing happens*/
                            Source = html
                        }
                    }
                }
            };
        }

        protected override void OnStart()
        {
            // Handle when your app starts
        }

        protected override void OnSleep()
        {
            // Handle when your app sleeps
        }

        protected override void OnResume()
        {
            // Handle when your app resumes
        }
    }
}

标签: c#xamarintizen

解决方案


检查这个页面

您不能在 Tizen TV 平台上使用 webview。


推荐阅读