答案 0 :(得分:1)
为什么不使用按钮而不是按钮,将文本添加为具有不同文本大小的标签,然后为该框提供点击手势?
将此添加到OnAppearing
var my_tap = new TapGestureRecognizer();
my_tap.Tapped += (s, e) =>
{
// do your thing;
};
YourBoxView.GestureRecognizers.Add(connect_tap);
或StackLayout:
<StackLayout x:Name="buttonStack" BackgroudColor="Blue">
<StackLayout.GestureRecognizers>
<TapGestureRecognizer Tapped="YourCode"></TapGestureRecognizer>
</StackLayout.GestureRecognizers>
<Label FontSize="Large">your text</Label>
<Label FontSize="Small">your other text</Label>
</StackLayout>