Hello I'm having some issues in Silverlight to make sure the scrollbar resets every time the user is navigated to another page. There is another issue I'm having where the scroll down arrow is not appearing when I debug my application. Any help will be appreciated
Here is an example on how to change the scroll-bar position
XAML
<ScrollViewer x:Name="ScrollBar>
</ScrollViewer>
Code Behind
ScrollBar.ScrollToHorizontalOffset(0d);
ScrollBar.ScrollToVerticalOffset(0d);
Change 0 to the position you want. 0 will bring it to the top.
As for the down arrow not appearing....that's a problem with your UI. Make sure the ScrollViewer doesn't extend off the screen.
Related
I'm trying to make Xamarin forms application, in which the data should look like this.
However, it can be seen that the height and width of the view are large and I need to scroll the page both horizontally and vertically. So, when I scroll only the data portion should move while the A and B axes stay constant. If I move to column B6 then the view should be as shown below
and from this point if I move row A5 the view should be as shown below.
I'm quite new to xamarin forms or any other android development programming. At this point, I'm just trying to know what kind of search terms that I should use where I can find some documentation related to make such kind of view in my application. I guess a simple idea can be just using a scrollbar but I need my axes points visible all the time even if I scroll far right or far below.
Any suggestions?
Thank you!
To your question, you can search with scrollview, it is a layout that's capable of scrolling its content. You can set the orientation of your scrollview as "both" so it can scroll both horizontally and vertically.
But it can only have one content to scroll. It means scrollView objects should not be nested with other controls that provide scrolling, such as CollectionView, ListView, and WebView. For more information, you can refer to https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/layouts/scrollview
I'm having an issue where my scrollbar for a panel on a usercontrol always appears at the bottom.
If I hover the mouse over the tab and cause the control to slide out and be shown, the scrollbar is at the bottom. If I then move the scrollbar to the top and move the mouse off the control (which causes it to hide again) and then move the mouse back over the tab (which causes the control to slide back out) the scroll bar is back at the bottom!
Setting the VerticalScroll.Value property on my panel to 0 is not having any effect - the control still shows at the bottom. Can someone tell me what events might fire when a control slides back into view on an autohide tab or just tell what I could do to solve this issue! I assume that the Paint event is what fires when the control is shown but I'm not entirely sure.
I did notice that in the VS designer that the scrollbar by default is shown at the bottom. Not sure whether this may have anything to do with the issue?
Any suggestions appreciated!
Try this:
scrollingCtrl.VerticalScroll.Value = 0;
scrollingCtrl.PerformLayout();
I've searched loads for an answer to my problem.
Basically on my WP8 app, I have an "add record" page and a list of text boxes. I can scroll up and down the full length of the page fine, but when I tap one of the text boxes and the keyboard appears, I can no longer scroll to the very bottom and therefore can't complete the last couple text boxes.
Now, if you have a look at the MS calendar app on WP8, the "new appointment" page has a similar thing - when you tap one of the text boxes you can still scroll the whole way up and down.
I was wondering, is there anywhere I can see the XAML that MS have used? Then I can learn from that. I'm sure it's as simple as setting a height property or something but I've been stumped on this for a while now.
Rather than posting my XAML etc, does anyone know where I can get a look at the XAML for the MS stock apps? If this is even possible...
Thanks
I had the same issue. but at last i solved it, i just used the Height property to do this. i already answered for the same type of problem posted by someone.Please do the following steps
First create a ScrollViewer
Indide the ScrollViewer create a container(eg: Grid/StackPanel/Border etc...) and put every controlls inside it.
Set fixed Height for ScrollViewer and the Container (Note: Height of container should be greater than ScrollViewer's Height)
See the below Code
<ScrollViewer Height="500">
<Grid Name="Container" Height="700">
<TextBox/>
<TextBox/>
<TextBox/>
</Grid>
</ScrollViewer>
Now you can scroll the container Grid Even the KeyBoard shown or even focus on a TextBox.
I have 3 pages in my application.
First page: 5 Buttons, each navigates to different page (currently, only the first button works).
Second page: Back Button and ListView, the ListViewItems are UserControlItems with Button, Image and TextBlock. When you click on the Button (of the UserControlItem) it Navigates to the third page, which is Media Player Page with alot of controls.
Third page: Media Player page with alot of controls such as MediaElement, Slider, Buttons and more
When I navigate from Third Page to Second Page using the Back Button, sometimes the screen stays black (the color of the theme) and sometimes it loads too much time. In addition, the ListView has visible vertical scrollbar (always) which is not shown unless you move your mouse on the ListView.
How to fix these problems?
EDIT 1:
link to my project - put some .wmv/.mp3/.mp4 files in the Videos Library folder.
EDIT 2:
I investigated the black page issue abit more and I found that the MediaElement is the cause.
The MediaElement stores the stream and it slows the computer.
In order to resolve to problem, when you click on the GoBack Button, it first set the source of the MediaElement to null, and only when the MediaElementState == Closed, I go back - seems to solve my problem (since I applied the solution I didnt experience more black screens).
About the scrollbar - I think I'll be able to solve it if I simulate MouseOver over the ListView - no idea how to do it
Ok Ill List out the issue one by one.
List View Scroll Bar : Since we are developing for a potential touch surface so scrollbars are not meant to be visible every time.
Blank Page : When you press the back button then Big page Ie third page gets stored in the forward navigation property of the history element. Additionally all the resources that were being used in the third page is disposed. So the time taken to go to second page becomes huge.
Please try havig a fourth page which will have less controls. And see if any Black background issue is occuring or not. It will give a better and clear picture.
--- Update Code for permanent visibility of scroll bar---
Please download the code for listview styling from
Listview styles
add your code to the project
and replace all FadeOutAnimation By FadeInAnimation.
This was the quickest I could do for a solution. For a Better one you can always play with the styles.
Ohh one more thing please add
Style="{StaticResource ListViewStyle1}"
To your list view. please try and let me know.
I'm very new to WPF. I was trying to add a button to a tab item (of a tab control I had already dragged in) in Visual C# 2010 Express. Upon doing this, the button repeatedly snapped to the center of the screen when I tried to drag-and-drop reposition it. Why is this happening, and how can I move the button? I haven't written any code, and the only properties of the button that I've changed are the size, content, and name.
I had the same/similar problem today. In my case the designer had created a <border></border> around my button, with size equal to the whole application window. So, when I was moving my button around I was actually moving the border and the button and the border was snapping to the application and the button - to the border. When I removed the border - all was fixed.
Diagram explanation
See if you have such a border or other encapsulating element which may cause this behaviour.