我在其中一个页面的JavaFX WebView独立应用程序中使用了以下标记
输入字符也接受字符
<input type="number" id="qNumber"/>
Run Code Online (Sandbox Code Playgroud)
输入类型日期,不作为日期控件呈现
<input type="date" id="qDate"/>
Run Code Online (Sandbox Code Playgroud)
文本类型输入仍然接受输入中的文本,但是当我在普通HTML页面中使用此标记(不在JavaFX)时,如在记事本中写入它,它工作正常.
如何解决此渲染问题?或者我在注册HTML文件的步骤中做错了什么?
注意:
我的Web引擎用户代理是Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/538.19(KHTML,如Gecko)JavaFX/8.0 Safari/538.19.
我已在 .Net Maui 中声明了全局样式并尝试从其中一个页面访问它,但它抛出异常
Microsoft.Maui.Controls.Xaml.XamlParseException:位置 10:37。类型转换器失败:调用目标已引发异常。Microsoft.Maui.Controls.Xaml.XamlParseException:位置 8:34。未找到主键的 StaticResource。
应用程序.xaml代码
<?xml version = "1.0" encoding = "UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MyApp"
x:Class="MyApp.App">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
<Style x:Key="redLabelStyle"
TargetType="Label">
<Setter Property="TextColor"
Value="Red"/>
<Setter Property="FontSize"
Value="Small"/>
<Setter Property="FontAttributes"
Value="Bold"/>
</Style>
<Style TargetType="Label">
<Setter Property="TextColor"
Value="Green"/>
<Setter Property="FontSize"
Value="Small"/>
<Setter Property="FontAttributes"
Value="Bold"/>
</Style>
</Application.Resources>
Run Code Online (Sandbox Code Playgroud)
MainPage.xaml代码
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
NavigationPage.HasNavigationBar="False"
x:Class="MyApp.MainPage">
<VerticalStackLayout HorizontalOptions="CenterAndExpand"
VerticalOptions="CenterAndExpand">
<Label Style="{StaticResource redLabelStyle}"
Text="Global Style Red Label"/>
<Label …Run Code Online (Sandbox Code Playgroud)