Telerik控件在Xamarin PCL项目中不显示(Telerik controls not showing in Xamarin PCL project)

编程入门 行业动态 更新时间:2024-10-25 22:28:48
Telerik控件在Xamarin PCL项目中不显示(Telerik controls not showing in Xamarin PCL project)

我使用telerik控件开始了我的Xamarin项目,由于某些原因,当我在android模拟器上部署应用程序时,它显示了一个空白的屏幕,请注意,我已经从我一步一步跟踪的Telerik演示示例中获取的Xaml代码直到我将这些控件应用到我的应用程序中。 所有的参考资料都按照例子。 看下面我的xaml页面。

<?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:telerikPrimitives="clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.XamarinForms.Primitives" xmlns:telerik="clr-namespace:Telerik.XamarinForms.DataControls;assembly=Telerik.XamarinForms.DataControls" xmlns:local="clr-namespace:PRPClockingXamarin" x:Class="PRPClockingXamarin.Views.MainPage" xmlns:telerikDataControls="clr-namespace:Telerik.XamarinForms.DataControls;assembly=Telerik.XamarinForms.DataControls"> <ContentPage.ToolbarItems> <ToolbarItem Activated="OnToolbarButtonClick" Order="Primary" Priority="0" Text="Open SideDrawer"> <ToolbarItem.Icon> <OnPlatform x:TypeArguments="FileImageSource" iOS="hamburgerButtonIcon.png" Android="hamburgerButtonIcon.png" WinPhone="Assets/hamburgerButtonIcon.png" /> </ToolbarItem.Icon> </ToolbarItem> </ContentPage.ToolbarItems> <Grid> <telerikPrimitives:RadSideDrawer x:Name="drawer" DrawerLength="250"> <telerikPrimitives:RadSideDrawer.MainContent> <Grid BackgroundColor="Gray"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Label Text="Transition Type:"/> <Picker Grid.Row="1" x:Name="picker" SelectedIndexChanged="picker_SelectedIndexChanged"> <Picker.Items> <x:String>Push</x:String> <x:String>Reveal</x:String> <x:String>ReverseSlideOut</x:String> <x:String>ScaleUp</x:String> <x:String>SlideAlong</x:String> <x:String>SlideInOnTop</x:String> </Picker.Items> </Picker> <Label Grid.Row="2" x:Name="descritpionLabel"> </Label> <Button Text="Open SideDrawer" IsVisible="false" x:Name="button1"/> </Grid> </telerikPrimitives:RadSideDrawer.MainContent> <telerikPrimitives:RadSideDrawer.DrawerContent> <Grid BackgroundColor="#826182" WidthRequest="220"> <ListView x:Name="drawerList" /> </Grid> </telerikPrimitives:RadSideDrawer.DrawerContent> </telerikPrimitives:RadSideDrawer> </Grid> </ContentPage>

I've started my Xamarin project using telerik controls, for some reason when I deploy the app on android simulator it shows a blank screen mind you that the Xaml code I've taken from a Telerik demo example that I followed step by step and it works perfectly up until I applied those controls into my App. All References are there as per example. See below my xaml page.

<?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:telerikPrimitives="clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.XamarinForms.Primitives" xmlns:telerik="clr-namespace:Telerik.XamarinForms.DataControls;assembly=Telerik.XamarinForms.DataControls" xmlns:local="clr-namespace:PRPClockingXamarin" x:Class="PRPClockingXamarin.Views.MainPage" xmlns:telerikDataControls="clr-namespace:Telerik.XamarinForms.DataControls;assembly=Telerik.XamarinForms.DataControls"> <ContentPage.ToolbarItems> <ToolbarItem Activated="OnToolbarButtonClick" Order="Primary" Priority="0" Text="Open SideDrawer"> <ToolbarItem.Icon> <OnPlatform x:TypeArguments="FileImageSource" iOS="hamburgerButtonIcon.png" Android="hamburgerButtonIcon.png" WinPhone="Assets/hamburgerButtonIcon.png" /> </ToolbarItem.Icon> </ToolbarItem> </ContentPage.ToolbarItems> <Grid> <telerikPrimitives:RadSideDrawer x:Name="drawer" DrawerLength="250"> <telerikPrimitives:RadSideDrawer.MainContent> <Grid BackgroundColor="Gray"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Label Text="Transition Type:"/> <Picker Grid.Row="1" x:Name="picker" SelectedIndexChanged="picker_SelectedIndexChanged"> <Picker.Items> <x:String>Push</x:String> <x:String>Reveal</x:String> <x:String>ReverseSlideOut</x:String> <x:String>ScaleUp</x:String> <x:String>SlideAlong</x:String> <x:String>SlideInOnTop</x:String> </Picker.Items> </Picker> <Label Grid.Row="2" x:Name="descritpionLabel"> </Label> <Button Text="Open SideDrawer" IsVisible="false" x:Name="button1"/> </Grid> </telerikPrimitives:RadSideDrawer.MainContent> <telerikPrimitives:RadSideDrawer.DrawerContent> <Grid BackgroundColor="#826182" WidthRequest="220"> <ListView x:Name="drawerList" /> </Grid> </telerikPrimitives:RadSideDrawer.DrawerContent> </telerikPrimitives:RadSideDrawer> </Grid> </ContentPage>

最满意答案

我从Telerik发现了上述问题的解决方案: -

这种行为的原因不是注册控件的渲染器或丢失RenderScript nuget包。

I found a solution on the above issue from Telerik : -

reason for such behavior would be not registering the control's Renderer or missing the RenderScript nuget package.

更多推荐

Telerik,xmlns,电脑培训,计算机培训,IT培训"/> <meta name="description&quo

本文发布于:2023-08-01 23:49:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1368013.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控件   中不   项目   Xamarin   Telerik

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!