我已經找到了解決辦法是使用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