ScrollViewer scrollbars not hiding/showing
I have an Image inside a ScrollViewer. The XAML has both the horizontal and vertical scrollbar visibility set to Auto. The initial Image is initially sized to the exact dimensions of the ScrollViewer. The initial view shows the entire image without any scrollbars. When I enlarge the Image, scrollbars appear, as expected. However, when I reset the size back to the initial dimensions, the scrollbars do not go away.
I tried to force the display of the scrollbars, but the methods for changing the scrollbar visibility do not seem to work. Here is my code:
I've also tried ScrollBarVisibility.Hidden, but that doesn't work, either.
I'm using v1.2.3 in Unity 5, running on Windows 8.1.
I tried to force the display of the scrollbars, but the methods for changing the scrollbar visibility do not seem to work. Here is my code:
Code: Select all
void buttonDebugZoom_Click(object sender, RoutedEventArgs e)
{
Debug.Log("+buttonDebugZoom_Click");
fDebugZoom = !fDebugZoom;
if (fDebugZoom)
{
Debug.Log(" zoomed in");
imgDebug.Width = cachedImageData.width/2;
imgDebug.Height = cachedImageData.height/2;
ScrollViewer.SetHorizontalScrollBarVisibility(svDebug, ScrollBarVisibility.Visible);
ScrollViewer.SetVerticalScrollBarVisibility(svDebug, ScrollBarVisibility.Visible);
buttonDebugZoom.Content = "Zoom -";
}
else
{
Debug.Log(" zoomed out");
imgDebug.Width = svDebug.ActualWidth;
imgDebug.Height = svDebug.ActualHeight;
ScrollViewer.SetHorizontalScrollBarVisibility(svDebug, ScrollBarVisibility.Disabled);
ScrollViewer.SetVerticalScrollBarVisibility(svDebug, ScrollBarVisibility.Disabled);
buttonDebugZoom.Content = "Zoom +";
}
}
I'm using v1.2.3 in Unity 5, running on Windows 8.1.
-
sfernandez
Site Admin
- Posts: 3184
- Joined:
Re: ScrollViewer scrollbars not hiding/showing
Ok, I was able to reproduce it here.
I will take a look and fix it as soon as possible.
I will take a look and fix it as soon as possible.
-
sfernandez
Site Admin
- Posts: 3184
- Joined:
Re: ScrollViewer scrollbars not hiding/showing
We fixed this issue for the upcoming 1.2.4 release.
Who is online
Users browsing this forum: Ahrefs [Bot], Semrush [Bot] and 3 guests