auto fit webview with height n width RRS feed

  • Question

  • am using web view for displaying some outside site.

    i dont want to give height n width,it should we fit to screen automatically.

    am used webvies inside stackpanel.

    Wednesday, March 15, 2017 10:46 AM


  • Hi sandy1985,

    Welcome to the Developing Universal Windows apps forum! Please utilize tagging when posting to this forum, thanks!

    You can try to use the following code to configure the WebView to make it fit screen automatically.

        <StackPanel  Name="stackPanel" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
            <WebView x:Name="webView1" Width="{Binding ActualWidth,ElementName=stackPanel}" Height="{Binding ActualHeight,ElementName=stackPanel}" Source="http://www.contoso.com"/>

    Best regards,

    Breeze Liu

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Edited by Breeze Liu Thursday, March 16, 2017 4:13 AM
    • Proposed as answer by Breeze Liu Friday, March 24, 2017 11:14 AM
    • Marked as answer by sandy1985 Thursday, May 18, 2017 4:04 AM
    Thursday, March 16, 2017 4:12 AM