我想创建具有点击可能性的标签,就像在 WIN 手机 xaml 中一样
<HyperlinkButton Content="My Text to click"/>
有可能在 Xamarin.Forms 中做到这一点吗?
我发现了这个,但不一样:
https://github.com/XLabs/Xamarin-Forms-Labs/wiki/HyperLinkLabel https://github.com/XLabs/Xamarin-Forms-Labs/wiki/HyperLinkLabel
我会采取更标准的方法并使用Button
。只需将背景设置为与您的应用程序背景相匹配并删除边框即可。那么就不需要额外的了TapGestureRecongniser
代码。 (下面是伪代码:)
Xaml:
<Button Text="Click Me!" Background= "YourAppBackground" BorderWidth="0" Clicked="OnButtonClicked" />
代码隐藏:
void OnButtonClicked(object sender, EventArgs args)
{
//Open your link in here
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)