I have a Template10 UWP application that I am developing, and for the most part everything is coming together nicely. However, I am a little stumped about the behavior of the PageHeader control when an AppBarButton has a Label set.
As you can see in the shot below, the header does not show the Label under the displayed Icon.
But when I click on the ... to expand the SecondaryCommands, the height adjusts to accomodate the Label and the dropdown menu is displayed properly. Is there a way to set this as the default behavior of the PageHeader and have the back arrow and title be vertically centered? It looks a little odd once the header expands and the title is still top aligned.
EDIT
I would like to note, that simply changing the VerticalAlignment of the PageHeader does not change this behavior at all. The result still looks the same. I thought perhaps if I changed the alignment then I would just have to manually set the Height. Also, even manually setting the Height doesn't change anything either, the Background stays the same height and the text doesn't move either.
EDIT 2
Sorry for the poor scaling, but here is what it looks like animated, for the most part:
I am hoping to vertically align the back arrow, Invoice Details, the AppBarSeparator, and the ellipses. The AppBarSeparator is easy, I just added VerticalAlignment="Center" and it adjusts. What I'm looking for is the expanded version of the header, with the mentioned items centered, that doesn't change height when clicking the ellipses.
I've looked through the source code for Template 10, and the closest thing I can find is the IsOpen property on PageHeader but if I set that to True then the header just looks like the second picture with the menu expanded. I am just looking for something to make the header look expanded, but without the menu (and stay expanded when menu appears, etc.)
Related
I have a UIButton which is created programmatically (it can be customised from Interface Builder, though). It is a circular and it looks like this:
Now I'm working on Internationalization and I need to check it for Double-Length Pseudolanguage. The image above is taken when the app language is set to double-length pseudo, but as you can see, the button only shows one word. Here are the constraints of the button:
The title style of the button is plain, its text is centre-aligned, and the line break is set to "Word Wrap".
How to make the button keep its shape but to increase its size when needed (basically, to increase its width and height for the same amount, so it keeps being a circle), so for example, in this case to show two "Menu" words? If you know how to achieve this I would appreciate your help.
Try setting the content compression resistance on the button to required (1000) for horizontal and vertical. It will also depend on the stackViews above and below allowing for the size change.
I want to fit the Image + Label into Scrollable View.
It looks like so My setup
So trouble here is that width of the picture and the label did not match the screen width.
I tried to change the UIImageView width from 400 to 300 or so, BUT those changes either wont take the effect(if above 300), OR those changes make label disappear (with width setted up on 300 or below). Observe.
Funny thing is - label actually appears when you see view hierarchy, even though it looks kinda distorted. But no label on the iOS screen for you, sir.
I also tried to set equal width and height from the superview, but this option just disabling scroll, making view strictly fit the screen (label appears to be cropped)
I want the label to be nice and scrollable, but I also want to see it on the screen. Too much to ask?
EDIT: I just tried removing Auto-layout and got the same as with auto-layout. (click "Observe" link to take a look again, exact same situation) Could somebody explain why?
This is quite a simple fix. For the image, you should use equal width & center horizontally; however, make sure you use a fixed width. For the image to look nice, play with the scale modes - I find Aspect Fit/Fill work best.
The label should also be equal width & centered horizontally. You may need to calculate the height of the label programmatically if the text isn't always going to be the same size.
So the answer to my particular question was - shortening the actual text that is passed to the label.
Apparently UIScrollView can't handle stuff with crazy abnormal heights (I was passing a huuuge text to it) So in my particular situation solution was - shorten the text. Now it works like a charm (even though I still need to play a little with constraints to get rid of the warnings and stuff)
I like the AppBarButtonStyle idea of using font character as button icon because of its scaling abilities, but it is of no use if i cannot resize them properly.
Changing Width or Height of button does not work, because AppBarButtonStyle only resizes padding between button icon and button borders. Changing FontSize of button does not work either.
Is there any way of resizing buttons styled with AppBarButtonStyle in WinRT application? I dont mind if i have to override or modify AppBarButtonStyle, as long as it preserves the ability to use font character as button icon.
Any useful advices will be appreciated!
You can easily create your own custom button from AppBarButtonStyle from the original in the standardstyles.xaml .
I did so to create a custom smaller button with no text and the only hard part was aligning everything: you're not adding shapes, you're adding a character, so it may not be as aligned as you think. Default Buttons contain 3 charatctes: outline, fill and glyph.
If you want, I can share my simplified code for the control.
I am not experienced in Windows Store (aka Metro) app XAML, so perhaps I am overlooking something simple, but according to books and samples, a vertical scrollbar is a natural part of a ListView control, and unless explicitly disabled will show up when there are invisible items in the ListView.
But on in the case of my app. I have a typical List/Detail page with items in the left pane - they are displayed fine, with scrollbar, and selected item details in the right pane. Selected item contains a collection of subitems, and they are supposed to be displayed with a scrollbar in case there are many of them. I have a simple ListView definition:
<ListView
x:Name="itemCollection"
Grid.ColumnSpan="1"
SelectionChanged="ItemListView_SelectionChanged"
ItemsSource="{Binding Elements}"
ItemTemplate="{StaticResource Custom80ItemTemplate}" />
Strange enough, I never see a scrollbar for this list. Only when I explicitly set its mode to "Visible", I can see a scroll bar, but there is nothing to scroll it with!
Obviously the program believes that the whole list is visible so scroll bar is unnecessary, but what can make it do such judgement?
I've finally fixed the problem. As most of such problems, the error was silly: a Grid control that owns this ListView had an extra (wrong) row definition that had Height property marked with asterisk, i.e. taking all remaining space. But the row that ListView was using had Height marked as "Auto", therefore it expanded to the whole size of its items and never activated its vertical scroll bar.
Try Setting the visibility to auto.
I plan on using a scrollbar for, well, scrolling an image. The image is 200x500, however, the only visible area is 200x250.
So I set the max value to 250, and the min value to 0. The idea is that if I drag the scrollbar's button to the bottom, 250 pixels will have moved for the image, right?
But wait, the scrollbar's button is.... very small. And the scrollbar is actually pretty long. Is there a way to make the scrollbar's button longer?
How did you create this scrollbar? Is it a separate control all together, or it is a component of another control? I do know that scrollbars added separately act kinda funny at times.
What I would suggest is using the scollbars built into another container control, which should achieve the exact same effect.
Create a new panel control on your form, and name it. (I suggest something like panelPicture)
Position the panel where you want your picture to be.
Set the panel's size to 200x250.
Set the panel's "Autoscroll" property to True.
Put a PictureBox inside this panel, and name it. (I suggest something like picMyPicture.)
Set the PictureBox's position to 0, 0.
Set the PictureBox's size to 200x500 (or whatever is necessary).
Set the PictureBox's Image property as desired.
Now, the scrollbar should automatically appear on the picture, and it should look normal.
As a side note (which may or may not be relevant), users typically don't like having to scroll to see the rest of an image, so if you don't need the user to scroll down on the image for some definitive purpose (or because you don't know what the size of the image that will be handled is), I'd try and change the size of things on your form so scrolling will not be necessary.
I hope this helps!