我已经找到了解决办法是使用JavaScript来改变CSS属性的元素:
private void FacebookLoginBrowser_Navigated(object sender, System.Windows.Navigation.NavigationEventArgs e)
{
// check for when this approve page has been navigated to
if (FacebookLoginBrowser.Source.AbsolutePath == "/connect/uiserver.php")
{
showBrowser();
// do the script injection on the LoadCompleted event - doing it here will appear to work when you have a fast connection, but almost certainly fails over 3G because the elements aren't ready in time to be modified
FacebookLoginBrowser.LoadCompleted += new System.Windows.Navigation.LoadCompletedEventHandler(FacebookLoginBrowser_LoadCompleted);
}
// etc ...
}
void FacebookLoginBrowser_LoadCompleted(object sender, System.Windows.Navigation.NavigationEventArgs e)
{
FacebookLoginBrowser.LoadCompleted -= FacebookLoginBrowser_LoadCompleted;
// Facebook will likely change this and break our code soon, so make sure you anticipates this
try
{
FacebookLoginBrowser.InvokeScript("eval", "document.getElementById('platform_dialog_bottom_bar').style.position = 'relative';document.getElementById('platform_dialog_bottom_bar').style.top = '-60px';");
}
catch
{
// TODO: display instruction to scroll down if we ever end up here
}
}
我希望帮助。如果遇到问题,请随时与我联系
顺便说一下,这是目前唯一的解决方案。我为Facebook C#SDK构建了原始的WP7演示。不幸的是,WP7 IE浏览器或Facebook的Html中有些东西是关闭的。我还没有弄清楚应该责怪谁(但我的猜测是Facebook正在做浏览器嗅探和定制渲染)。无论如何,直到Facebook解决问题或芒果出来,这是解决方案.. – DevTheo 2011-06-08 12:46:34