隐藏取消和导航在webview嵌入B2C



我正在xamarin表单中使用b2c进行身份验证,他们要求我嵌入触发的弹出屏幕,然后隐藏或消除取消和导航栏,是否有人完成了这一部分或以其他方式修改了它?(提前感谢(在此处输入图像描述

请检查以下引用是否可以在您的情况下使用:

隐藏取消按钮:

在自定义策略中

在需要的登录或注册或页面的自定义策略技术配置文件中将setting.showCancelButton元数据项配置为false

示例:

<TechnicalProfile Id="LocalAccountSignUpWithLogonEmail">
<DisplayName>Email signup</DisplayName>
<Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Metadata>
<Item Key="IpAddressClaimReferenceId">IpAddress</Item>
<Item Key="ContentDefinitionReferenceId">api.localaccountsignup</Item>
<Item Key="language.button_continue">Create</Item>
<Item Key=" setting.showCancelButton ">false</Item>
</Metadata>
<InputClaims>….
….
</TechnicalProfile>

参见自我断言的技术概要参考&微软问答;参考

通过Xamarin形式:

对于Xamarin表单,使用Xamarin.forms渲染器隐藏";取消";使用Control.ShowsCancelButton = false的iOS上搜索栏的按钮;

protected override void OnElementPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
base.OnElementPropertyChanged(sender, e);
if (e.PropertyName == "Text")
{   Control.ShowsCancelButton = false;}
}

参考文献:

  1. Xamarin表单-iOS禁用SearchBar上的取消按钮(weblogs.us(
  2. 如何在Xamarin Forms堆栈溢出中处理/取消反向导航

禁用导航栏:

如果您在NavigationPage或NavigationPage中使用webview包装内容页,请尝试将NavigationPage.HasNavigationBar="False"添加到您的contentpage标记中,如下面的xaml,以禁用导航栏。

示例:

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"              
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"          
xmlns:local="clr-namespace:FormsWebViewTest"              
x:Class="FormsWebViewTest.MainPage"         
NavigationPage.HasNavigationBar="False">
...........
.......//other part
</ContentPage>

或者在导航页上将HasNavigationBar设置为false(在内容页构造函数中(。

例如:

public MyPage()
{
InitializeComponent();
NavigationPage.SetHasNavigationBar(this, false);
}

最新更新