我的Xamarin.Forms项目中有一个页面,我需要看起来像这样:
我可以放置红色和蓝色框,没问题。但是我不知道如何创建绿色的。
我使用的XAML如下:
<StackLayout HorizontalOptions="FillAndExpand">
<StackLayout VerticalOptions="FillAndExpand" BackgroundColor="Red">
//I'm thinking the green box should be positioned absolutely in here or something?
</StackLayout>
<StackLayout VerticalOptions="End" BackgroundColor="Blue">
<Grid VerticalOptions="EndAndExpand">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Text="Button" HorizontalOptions="FillAndExpand" BorderRadius="0" VerticalOptions="EndAndExpand" HeightRequest="50" TextColor="White" BackgroundColor="#85C034"></Button>
</Grid>
</StackLayout>
</StackLayout>
Run Code Online (Sandbox Code Playgroud) 我有一个Microsoft SQL数据库,其中包含一个名为Bookings的表,其中包含一列EndDate和一个列Status.
每当在预订中插入一行时,它会将状态设置为不可用并插入EndDate(从现在开始一周).
我想要做的是当当前日期和时间等于EndDate时自动将状态从不可用更新为可用.
因为我正在运行Express Edition,所以无法使用SQL Server代理作业.
谢谢
我希望我的应用中的每个页面顶部都有一个透明的工具栏,以及一个覆盖整个页面的背景图像.
在App.xaml.cs中,我写了以下内容:
MainPage = new NavigationPage(new MDMaster())
{
BarBackgroundColor = Color.Transparent,
BackgroundImage = "background_1.png"
};
Run Code Online (Sandbox Code Playgroud)
这将正确使工具栏透明,但不显示背景图像.我可以添加背景颜色而不是背景图像.
MDMaster是MasterDetailPage的主要组件.在MDMaster页面上,我设置了Detail页面,如下所示:
Detail = new NavigationPage(new ProfilePage())
{
BarBackgroundColor = Color.Transparent,
BackgroundImage = "background_1.png"
};
Run Code Online (Sandbox Code Playgroud)
这甚至都没有显示背景图像.
在ProfilePage上,我可以写:
public ProfilePage()
{
InitializeComponent();
this.BackgroundImage = "background_1.png";
}
Run Code Online (Sandbox Code Playgroud)
这将显示背景图像,但它不会覆盖工具栏后面的区域,即使它是透明的.最终看起来像这样: