我在 Ios 中有主详细信息页面,现在我需要在单击主页面中的按钮时在详细信息页面中显示一些值。有人可以帮助我实现它。
public class StoresTabletPage : MasterDetailPage
{
public StoresTabletPage()
{
Title = "Stores";
Detail = new ContentPage
{
IsVisible = true,
MinimumWidthRequest = 100,
Content = new StackLayout
{
VerticalOptions = LayoutOptions.Center,
HorizontalOptions = LayoutOptions.Center,
Children =
{
new Label { Text = "Label1", FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)) }
}
}
};
Master = new ContentPage
{
MinimumWidthRequest = 500,
Title = "string",
Content = new StackLayout
{
VerticalOptions = LayoutOptions.Center,
HorizontalOptions = LayoutOptions.Center,
Children =
{
new Button{ Text = "1", FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Button)) }
}
}
};
因此,当在母版页中单击按钮时,它应该在详细信息页中显示 label1。
使用按钮上的命令和命令参数传递要在详细信息页面上显示的值
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句