Mar*_*ván 10
如果通过操作栏/导航表示顶部的导航栏,您可以使用此方法:
private void ShowToolbar()
{
if (Device.OS == TargetPlatform.iOS)
{
// move layout under the status bar
this.Padding = new Thickness(0, 20, 0, 0);
toolbarItem = new ToolbarItem("Sync", "sync_icon.png", () =>
{
//if (!response)
//{
// response = true;
SyncService();
//}
//else
// return;
}, 0, 0);
ToolbarItems.Add(toolbarItem);
}
if (Device.OS == TargetPlatform.Android)
{
toolbarItem = new ToolbarItem("Sync", "sync_icon.png", () =>
{
//if (!response)
//{
SyncService();
//}
//else
// return;
}, 0, 0);
ToolbarItems.Add(toolbarItem);
}
if (Device.OS == TargetPlatform.WinPhone)
{
toolbarItem = new ToolbarItem("Sync", "sync_icon.png", () =>
{
//if (!response)
//{
// response = true;
SyncService();
//}
//else
// return;
}, 0, 0);
ToolbarItems.Add(toolbarItem);
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6118 次 |
| 最近记录: |