xaml – Xamarin在按钮内部形成子控件

我想在我的xamarin表单应用程序中的一个按钮内放置一些子控件.我尝试了以下代码,但子控件没有显示.
<Button>
<StackLayout Orientation="Horizontal">
  <Image Source="updatesite.png" HeightRequest="25" WidthRequest="25"/>
  <Label VerticalOptions="Center" Text="Update Site and Settings" FontSize="16"/>
</StackLayout>
</Button>

请帮我.

您应该将所有内容包装到Grid等布局中.然后将透明按钮放在网格上.像这样.
<Grid>
    <Grid.RowDeFinitions>
        <RowDeFinition Height="25"/>
        <RowDeFinition Height="25"/>
    </Grid.RowDeFinitions>
    <Image Grid.Row="0" Source="updatesite.png" />
    <Label Grid.Row="1" VerticalOptions="Center" Text="Update Site and Settings" FontSize="16"/>
    <Button Grid.Row="0" Grid.RowSpan="2" x:Name="buttonDo" 
        BackgroundColor="Transparent" TextColor="Transparent"
    />
</Grid>

这个网格就像一个有孩子的按钮.

相关文章

Windows2012R2备用域控搭建 前置操作 域控主域控的主dns:自...
主域控角色迁移和夺取(转载) 转载自:http://yupeizhi.blo...
Windows2012R2 NTP时间同步 Windows2012R2里没有了internet时...
Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...