Xaml 按钮中的堆栈布局Xamarin窗体
是否可以在按钮中放置stacklayoutXaml 按钮中的堆栈布局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 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);
不,但是你可以让你的堆栈布局看起来像一个按钮。