Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xaml 按钮中的堆栈布局Xamarin窗体_Xaml_Xamarin_Xamarin.forms - Fatal编程技术网

Xaml 按钮中的堆栈布局Xamarin窗体

Xaml 按钮中的堆栈布局Xamarin窗体,xaml,xamarin,xamarin.forms,Xaml,Xamarin,Xamarin.forms,是否可以在按钮中放置stacklayout <StackLayout HorizontalOptions="Start" Orientation="Horizontal"> <Label Text="s" FontFamily="icon-font" FontSize="16" FontAttributes="Bold" TextColor="{StaticResource orangeColor}"></Label>

是否可以在按钮中放置stacklayout

      <StackLayout HorizontalOptions="Start" Orientation="Horizontal">
             <Label Text="s" FontFamily="icon-font" FontSize="16" FontAttributes="Bold" TextColor="{StaticResource orangeColor}"></Label>
             <Label Text="Test" FontSize="16" FontAttributes="Bold" />
      </StackLayout>

我有一个图标字体文件。我想呈现图标和按钮内容内的普通文本。是否可以在Xamarin表单中执行此操作?

您可以在标签中添加一个按钮,以便像按钮一样“单击”标签

var tapGestureRecognizer = new TapGestureRecognizer();
tapGestureRecognizer.Tapped += (s, e) => {
   // handle the tap
};
myLabel.GestureRecognizers.Add(tapGestureRecognizer);

不,但是你可以让你的堆栈布局看起来像一个按钮。