HyperlinkButton在C#XAMARIN.FORMS [英] HyperlinkButton in C# XAMARIN.FORMS
本文介绍了HyperlinkButton在C#XAMARIN.FORMS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要像在WIN手机XAML创建点击可能性标签
I want to create Label with click possibility like in WIN phone xaml
<HyperlinkButton Content="My Text to click"/>
有没有可能做到在Xamarin.Forms?
Is there a possibility to do it in Xamarin.Forms?
我发现这不过是不一样的:
I found this but is not the same:
的https://github.com/XLabs/Xamarin-Forms-Labs/wiki/HyperLinkLabel
推荐答案
我会建议使用 GestureRecognizers
并添加点击手势
来的标签。 编号:这里
I would suggest using GestureRecognizers
and adding a Tap Gesture
to a label. Ref: here
var label = new Label()
{
Text="My Hyperlink"
};
var tapGestureRecognizer = new TapGestureRecognizer();
tapGestureRecognizer.Tapped += (s, e) => {
// handle the tap
};
label.GestureRecognizers.Add(tapGestureRecognizer);
GestureRecognizer
是一个公共财产查看
类标签
从继承。看到这里
GestureRecognizer
is a public property on the View
class which Label
inherits from. See here
这篇关于HyperlinkButton在C#XAMARIN.FORMS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文