i want to make my page scrollable.
as you can see in image that, there are 9 buttons and no room for adding more buttons
so, how can i add more buttons and make page scrollable so that any button can be selected?
i already tried to enclose all these button in scroll viewer but it didn't worked, it scrolls but when i release my finger from screen it quickly goes back i.e. i can see buttons which are at bottom but can't select those.
You have to give a particular height to your scrollviewer because by default s always get to set to the height of the contents in it so no scrolling :).
Just Set the Height Property of your Scrollviewer to some value. Like:-
<ScrollViewer Height="700">
Content..
</ScrollViewer>
cheers :)
Related
I want to keep an always topmost canvas on a listview. Canvas should be stretch on window and if the user tries to scroll listview, listview must scroll but canvas must be topmost transparently and user can see listview. My XAML tree like below that:
<Grid>
<ScrollViewer>
<ListView>
</ListView>
</ScrollViewer>
<Canvas Name="DxPanel"></Canvas>
</Grid>
I am trying to make a note taking app. The reqirements like that:
Each listview has image or richeditbox control (I have already done it)
The user can draw something on image or rich text
The listview must have infinite scroll ability and data of list view must retrieve from database and data and UI recycling must be supported.
The drawing layer must be endless scroll
I know this is hard challenge. I am planning to save stroke , and text data in db and image data in disk.
First of all, I need to say, there is no need to put a ListView inside a ScrollViewer, by default ListView can be scrolled if there are many items, this is because there is a ScrollViewer inside the template of ListView, you can refer to the default ListView styles and templates.
Then, if your Canvas keeps covering the ListView, there is no way for your ListView to get focused, let alone make the ListView scrolling. So I suggest you to rethink about this, why should your Canvas be topmost transparently?
If you want your ListView can be scrolled/focused, and in the meanwhile your layout in the Canvas can be seen, then you can put the ListView above the Canvas, by default the background of ListView is transparent.
You can leave a comment to tell us what is in your Canvas, why this Canvas should be stretch and placed on the top of the ListView, maybe we can try to find other way to solve your problem.
I'm developing a small Universal App under Windows 10 and Visual Studio 2015 and one of the first things I need to do is add an AppBar in my XAML code to display the standard bar with button at the top of the screen. But for some reason, when I write the following code, I get an ellipse (3 points) at the right and when I click it, immediately to the left of it, there's a black box that I want to get rid of. All I want is to add buttons to it.
Here is my code:
Here is what the output shows:
There's nothing in the code that displays this black area that overlays my buttons when I click the ellipse. Where is this coming from and how do I get rid of it?
Adding on to Justin XL's excellent response, to hide the ellipse in my BottomAppBar, I had to go to App.xaml. Near the bottom of the newly created AppBar style, set the ExpandButton visibility to collapsed:
<Button x:Name="ExpandButton" ... Visibility="Collapsed" .../>
Basically, I want to be able to create a menu which on clicking on some button will appear from left (or right) and on clicking anywhere on main screen the user would be able to dissmis the menu. For example the facebook app has something similar on all platforms (so on Windows 8 also).
I have found a solution for Windows phone (http://sviluppomobile.blogspot.cz/2013/08/add-lateral-menus-to-windows-phone.html), which is not the way to go for Windows 8. Maybe I could use some hand made animation for aflyover, which would be in default outside of viewport. However, I guess there must be better or ideally already proofed solution.
Also I found two questions here on SO, which asked for same thing I guess, but no answers there ...
How to do: lateral menu like in "Music" app on Windows 8 / 8.1 and
https://stackoverflow.com/questions/22613421/windows-8-1-apps-left-menu
I know, that it is not the best way on windows platform to implement menu (we have top app bar, right), but our customer just wants this.
I would like to ask for some hints or ideally a code for a native implementation for Windows 8.1 using XAML (C# or VB.NET). Thanks to everybody who will give it a thought.
You'd put a StackPanel with Orientation="Horizontal" in a ScrollViewer. Put three panels in the StackPanel - let's make them Grids and call them: left, middle and right. On SizeChanged events of the ScrollViewer - set the Width and Height of the middle grid to the same values as ActualWidth and ActualHeight of the ScrollViewer and perhaps set the left and right grids to be a little bit narrower to leave space to see a little bit of the middle panel when you scroll to the ends. Make the ScrollViewer scroll horizontally by setting Horizontal/VerticalScrollMode and scroll bar visibilities and make the ScrollViewer snap to your grid panels by setting the HorizontalSnapPointsType and HorizontalSnapPointsAlignment properties. Also set IsHorizontalRailEnabled on the horizontal ScrollViewer to true if you have any vertical ScrollViewers in your panels and make their IsVerticalRailEnabled="true" so only one of them scrolls depending on the manipulation direction. Finally - put a transparent overlay panel as a top child of the middle panel handle the tap events on the overlay to scroll the middle panel back into view when it isn't centered and in the handlers of the menu buttons scroll the horizontal ScrollViewer to the start/end.
When user clicks on the scroll bar arrow, the content shifts very slow(horizontal offset changes on 16). How can I increase the speed of shifting when I click on arrows?
(SmallChange doesn't work)
Unfortunately, it's quite hard-coded in the scroll viewer.
The only way I know of, is to make a new panel based on the panel that you want to use in the scroll viewer, and implement IScrollInfo for it.
Then, setting this panel as the content of the scroll viewer and setting CanContentScroll to true.
StackPanel implements IScrollInfo but other panels do not.
In my app I use a page control and a UIScrollView to page horizontally, I'd like to be able to enable vertical scrolling on each page. Now I know you can nest UIScrollViews in order to achieve this, there is however one problem in my project. Each of the pages uses a view controller consisting of a view, with a background image (different image for each page). This background image should not move while scrolling up and down.
Now what I want is the ability to have buttons, regular rect buttons, which I create in Interface Builder (since I want to be able to design and update the positions easily) and which then can be scrolled vertically.
So it should be like this:
You see a screen with a page-control on the bottom, above it an image with buttons over it. When you scroll sideways, you go to another page, again with an image (another one) and with different buttons. Now whenever you scroll vertically on a page, the buttons should be scrollable (so I can have a LOT of buttons on 1 page), but the image should maintain it's position.
So I figured, I just add another scroll view on top of the view with the background image. This works fine since I now have my buttons hovering over the background image and I have a separate nib file for each page including the buttons. But when I do it like this, the scrollview with the buttons becomes un-scrollable vertically. I don't know why this is happening, so could anyone suggest me how to achieve the wanted result?
I'd be really really grateful!
Thanks,
Fabian