Xamarin.Forms.PancakeView

Xamarin.Forms 的扩展 ContentView,带有圆角,边框,阴影等!「An extended ContentView for Xamarin.Forms with rounded corners, borders, shadows and more!」

  • 所有者: sthewissen/Xamarin.Forms.PancakeView
  • 平台: Android, iOS, Mac, Samsung Tizen, Universal Windows Platform (UWP), Windows
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

Xamarin.Forms.PancakeView

Xamarin.Forms的扩展ContentView,带有圆角、边框、阴影等!

为什么选择 PancakeView?

在很多 Xamarin.Forms 用户界面工作中,我确实需要一种可用于支持渐变、边框、圆角和阴影的布局/视图。 由于现有的 Xamarin.Forms 控件都不符合要求,因此我决定自己动手做。 为什么要问它为什么叫 PancakeView? 好的,pancakes(煎饼)也很圆,有阴影并且有光彩的渐变色。 您能想到什么更合适的?

如何使用它?

我们有一篇 很棒的 Wiki 文章对此做了解释!

平台支援

我们的 Wiki 上保留了对每个功能的平台支持。

属性参考

每个单独功能的属性参考均在我们的 Wiki 上维护。

主要指标

概览
名称与所有者sthewissen/Xamarin.Forms.PancakeView
主编程语言C#
编程语言C# (语言数: 1)
平台Android, iOS, Mac, Samsung Tizen, Universal Windows Platform (UWP), Windows
许可证MIT License
所有者活动
创建于2019-02-13 10:25:31
推送于2022-10-10 12:40:38
最后一次提交2022-10-10 14:40:38
发布数7
最新版本名称v2.3.0.759 (发布于 )
第一版名称v1.4.2 (发布于 )
用户参与
星数856
关注者数26
派生数107
提交数318
已启用问题?
问题数130
打开的问题数40
拉请求数36
打开的拉请求数0
关闭的拉请求数8
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?

Xamarin.Forms.PancakeView

An extended ContentView for Xamarin.Forms with rounded corners, borders, shadows and more!

Build Status

Why PancakeView?

In a lot of Xamarin.Forms UI work I do I have the need for a layout/view that I can use that supports gradients, borders, rounded corners and shadows. Since none of the existing Xamarin.Forms controls fit the bill I decided to roll my own. And why is it called a PancakeView you ask? Well, pancakes are also round, have shadows and have a glorious gradient color. What better fit can you think of?

How to use it?

The project is up on NuGet at the following URL:

https://www.nuget.org/packages/Xamarin.Forms.PancakeView

You could also simply clone the repository and include the projects in the src folder in your Xamarin.Forms and Platform projects. It uses multi-targeting to resolve to the correct platform.

The first thing we need to do is tell our XAML page where it can find the PancakeView, which is done by adding the following attribute to our ContentPage:

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"  xmlns:yummy="clr-namespace:Xamarin.Forms.PancakeView;assembly=Xamarin.Forms.PancakeView">
   ...
</ContentPage>

Next up, just smack a PancakeView onto that page and you're all set, simple as baking real pancakes!

<yummy:PancakeView BackgroundColor="#bc91d7" CornerRadius="60,0,0,60" IsClippedToBounds="true" HorizontalOptions="FillAndExpand" HeightRequest="150">
   <Image Source="unicorn.png" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Aspect="AspectFill" />
</yummy:PancakeView>

Additional setup for UWP

PancakeView supports calling an Init() method to prevent the linker from stripping it out of your code that you can call in each platforms initializer. However, for UWP this might not be enough. When the .NET Native tool chain is used (e.g., to submit to the Microsoft Store), the renderer could be missing. To prevent this from happening, replace the Init() call in your App.xaml.cs file with the following:

List assembliesToInclude = new List();
assembliesToInclude.Add(typeof(Xamarin.Forms.PancakeView.UWP.PancakeViewRenderer).GetTypeInfo().Assembly);
Xamarin.Forms.Forms.Init(e, assembliesToInclude);

Platform support

At the time of this writing PancakeView has full support for iOS and Android, but only partial support for UWP. The matrix below shows which features are and aren't supported on UWP. Feel like implementing one of them? I'm taking PRs! ☺️