Xamarin Forms在iOS上隐藏按钮并在Android上显示 [英] Xamarin Forms Hide a Button on iOS and Show it on Android

查看:191
本文介绍了Xamarin Forms在iOS上隐藏按钮并在Android上显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在iOS上隐藏按钮,标签或网格单元并在android上显示,我有一个xamarin.forms应用程序(便携式),我知道我必须在平台上使用,但如何访问控件.

How to hide a button, a label or a grid cell on iOS and show it on android, I have a xamarin.forms app (portable), I know that I have to use on platform but how to access the visibility of the controls.

谢谢

推荐答案

// IOS, Android, WP
SomeButton.IsVisible = Device.OnPlatform<bool>(false, true, true);

if (Device.OS == TargetPlatform.Android)
{
    SomeButton.IsVisible = true;
}
else
...

这篇关于Xamarin Forms在iOS上隐藏按钮并在Android上显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆