Xamarin Forms complexe可点击标签

Xamarin Forms complexe可点击标签,xamarin,xamarin.forms,Xamarin,Xamarin.forms,我正在尝试创建一个包含经典作品的字符串&链接词 我有这样一句话: 我接受使用条款和隐私政策 在这句话中,我想让粗体字可以点击 我已经尝试了水平堆叠布局、标签和按钮,但结果不像一句简单的句子 有什么想法吗?在标签上使用标签识别器: var terms = new Label() { Text = "terms of use" }; var termsTapped = new TapGestureRecognizer(); termsTapped.Tapped += (o,e) => {

我正在尝试创建一个包含经典作品的字符串&链接词

我有这样一句话:

我接受使用条款隐私政策

在这句话中,我想让粗体字可以点击

我已经尝试了水平堆叠布局标签按钮,但结果不像一句简单的句子


有什么想法吗?

在标签上使用
标签识别器

var terms = new Label() { Text = "terms of use" };
var termsTapped = new TapGestureRecognizer();
termsTapped.Tapped += (o,e) =>
{
    //do something
};
terms.GestureRecognizers.Add(termsTapped);

var stack = new StackLayout()
{
    Orientation = StackOrientation.Horizontal
};
stack.Children.Add(new Label() { Text = "I accept the " });
stack.Children.Add(terms);
。。。您的隐私政策也是如此

编辑:

如果您想在单个标签中使用此功能,您可以实现自己的
Span
,它可以单击并使用
FormattedString

确定。我将尝试使用多标签。如果显示不正确,我将实现我自己的span。这就是方法。;-)如果我能帮忙,请标记为答案。完成后,我会将实现标记为答案:)