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! ☺️