我遇到了 bandClient.TileManager.SetPagesAsync 的问题,它返回 true,我认为这意味着一切都成功了,但是当我点击我的乐队磁贴时,什么都没有显示。我省略了下面的图块创建代码,因为我相信它可以正常工作,因为我能够成功地向它发送消息。有任何想法吗?
private void CreateLeaderboardPageLayout(BandTile tile)
{
// create a scrollable vertical panel that will hold 3 text messages
ScrollFlowPanel panel = new ScrollFlowPanel
{
Rect = new PageRect(0, 0, 245, 102),
Orientation = FlowPanelOrientation.Vertical
};
// add the text block to contain the first message
panel.Elements.Add(new TextBlock
{
ElementId = (short) TileMessagesLayoutElementId.Message1,
Rect = new PageRect(0, 0, 245, 102),
// left, top, right, bottom margins
Margins = new Margins(15, 0, 15, 0),
Color = new BandColor(0xFF, 0xFF, 0xFF)
});
// add the text block to contain the second message
panel.Elements.Add(new TextBlock
{
ElementId = (short)TileMessagesLayoutElementId.Message2,
Rect = new PageRect(0, 0, 245, 102),
// left, top, right, bottom margins
Margins = new Margins (15, 0, 15, 0),
Color = new BandColor(0xFF, 0xFF, 0xFF)
});
// add the text block to contain the third message
panel.Elements.Add(new TextBlock
{
ElementId = (short)TileMessagesLayoutElementId.Message3,
Rect = new PageRect(0, 0, 245, 102),
// left, top, right, bottom margins
Margins = new Margins(15, 0, 15, 0),
Color = new BandColor(0xFF, 0xFF, 0xFF)
});
// create the page layout
var layout = new PageLayout(panel);
tile.PageLayouts.Add(layout);
}
public async Task UpdateLeaderBoard(IBandClient bandClient)
{
// create the object containing the page content to be set
var pageContent = new PageData(MSC_LEADERBOARD_GUID, 0,
new TextBlockData((Int16) TileMessagesLayoutElementId.Message1,
"This is the text of the first message"),
new TextBlockData((Int16) TileMessagesLayoutElementId.Message2,
"This is the text of the second message")
,
new TextBlockData((Int16) TileMessagesLayoutElementId.Message3,
"This is the text of the third message")
);
var added = await bandClient.TileManager.SetPagesAsync(MSC_TILE_GUID, pageContent);
}