问题
I'm developing a silverlight site, using deepzoom. When I call a function to ArrangeImages(), in IE, the image arranges correctly, using 100% of the screen. In Chrome it works as well. In Firefox, though, the msi container only uses around 80% of the screen. I'm resizing it using these 2 lines of code below:
msi.Height = App.Current.Host.Content.ActualHeight;
msi.Width= App.Current.Host.Content.ActualWidth;
Any idea on how to solve this, or why the heck is this happening?
Thanks for your help.
回答1:
I'm guessing that the problem is either:
- The Silverlight object tag or Javascript is using a 100% height and width div, which doesn't work in Firefox unless all the parents have height and width set. You can verify this is the problem by setting a background color for the entire Silverlight object. If so, you can either specify a pixel height and width, or you can make sure height and width are set for all the parent elements for the Silverlight object.
- You may be setting the height and width before they're available. It's recommended that you access them in the OnResize event (see the "Important Note" on this MSDN page). What event are you setting them from?
来源:https://stackoverflow.com/questions/1448898/firefox-and-silverlight