简体   繁体   English

自定义导航栏 xamarin

[英]Custom navigation bar xamarin

Hello I'm trying to create this custom navigation bar,but I can't find anywhere if this is even possible.您好,我正在尝试创建此自定义导航栏,但如果可能的话,我在任何地方都找不到。 here.这里。 I wonder if is possible to add this custom size bar.I know how to add the green/blue one, what I need is to add this custom size image in purple.我想知道是否可以添加这个自定义尺寸栏。我知道如何添加绿色/蓝色栏,我需要的是添加这个自定义尺寸的紫色图像。

在此处输入图像描述

Here is a workaround for this issue.这是此问题的解决方法。 You can draw a testing image like following picture(Note:My picture have a blank view in the top, I do not have tools(such as) to fix that).您可以绘制如下图所示的测试图像(注意:我的图片顶部有一个空白视图,我没有工具(例如)来修复它)。

在此处输入图像描述

Then I used AbsoluteLayout to make a custom navigation bar with following code.(Note:There is a blank space at the top of my picture, so I have to adjust the placement, you can adjust it with your layout)然后我用AbsoluteLayout做了一个自定义导航栏,代码如下

 <AbsoluteLayout  >
        
            <Image Source="my.png"   BackgroundColor="Transparent"  AbsoluteLayout.LayoutBounds="0,-0.025,1,100" AbsoluteLayout.LayoutFlags="XProportional,YProportional,WidthProportional"
              />

        <Label Text="Hi,Luisa" TextColor="Black" AbsoluteLayout.LayoutBounds="0,0.01,50,20" AbsoluteLayout.LayoutFlags="PositionProportional" />

        <Label Text="Credit:Rs 255.00" TextColor="Black" AbsoluteLayout.LayoutBounds="0.95,0.01,150,20" AbsoluteLayout.LayoutFlags="PositionProportional" />
    
    </AbsoluteLayout>
   

Here is running screenshot.这是运行截图。

在此处输入图像描述

Or you can use Skiasharp to draw it.或者你可以使用 Skiasharp 来绘制它。 https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/graphics/skiasharp/basics/circle https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/graphics/skiasharp/basics/circle

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM