I'm using the latest version of the SL Toolkit for SL3. The TimePicker works great but is slightly too big. There's plenty of white space before the actual time.
I tried to resize the control by setting MinWidth and Width but the TextBox dislaying the time doesn't get resized below a width of 120 and therefore the right part gets hidden.
Did anyone encounter the same issue and has a fix for it? I tried overloading the ContentTemplate but without any luck.
You need to actually set the TimeUpDownStyle instead, since the TimePicker control is a composite, it is actually the TimeUpDown control inside it (a template part) that has a MinWidth set to 100 inside it - and setting the style will help fix that.
Consider using code like this to make the new minimum width 30 for the TimeUpDown part of the control:
<Grid.Resources>
<Style x:Key="smallMinimumWidth" TargetType="inputToolkit:TimeUpDown">
<Setter Property="MinWidth" Value="30" />
</Style>
</Grid.Resources>
<inputToolkit:TimePicker TimeUpDownStyle="{StaticResource smallMinimumWidth}" />
Hope this helps!
Related
Got the problem that the softkeyboard overlaps an entry field placed at the bottom.
XAML code:
<ContentPage.Content>
<AbsoluteLayout VerticalOptions="Fill">
<ScrollView AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0,0,1,0.9">
<Label Text="Heading" />
</ScrollView>
<Entry x:Name="SearchEntry" AbsoluteLayout.LayoutBounds=".5,1,1,.1" AbsoluteLayout.LayoutFlags="All" Placeholder="Suchen..." ReturnType="Done" />
</AbsoluteLayout>
</ContentPage.Content>
I installed the KeyboardOverlap! plugin via nuget. It shifts the whole page upwards till the entry is visible again. The entry is visible, but the top of the page isn't visible anymore because it's shifted up.
Another often mentioned solution is wrapping the pages's content in a ScrollView. Because I definitively need an AbsoluteLayout as root content, that's unfortunately not a solution.
I'm looking for a solution which shrinks the height of the page and don't just shifts it up when the softkeyboard appears.
Why I need this? The page is filled dynmically with search result based on the entrie's input. If there are only few result, they're not visible because of the page's upward shift. The user could think that there aren't any search results. Displaying a text like 'No search results.' above the entry would be a simple solution but is not an option here.
Using this CustomRenderer class in the iOS project instead of the KeyboardOverlap plugin did the trick.
Don't forget to customize line 14 with your concrete page classname(s) where you need the functionality. Otherwise the renderer is called for all pages in your app!
Many thanks to Jack Hua - MSFT!
I used animated input from W3 CSS. It takes 100% of the width when I click on it, but I only want it to take up 75% of the width when I click on it.
The code is:
<input class="w3-input w3-border w3-animate-input" type="text" style="width:30%">
The property you are trying to change is controlled by a pseudo-class. You need to change the width of w3-animate-input:focus {width:75%;}. You must add this to your code. You can add this to
the head section of your page between <script> tag.
the w3.css file if you are hosting it on your website.
I'm relatively new to programming and my problem is with a TMainMenu on my form.
I researched a lot (a whole lot) of sites for a solution, but haven't found any that solves this exact problem.
The main menu won't resize, not even when I change the fontsize using Screen.MenuFont.Size. I tried setting the Height property in the OnMeasureItem handler, I tried resizing the images and sub-menuitems at both design- and runtime, I even tried capturing Windows' message WMDrawItem and changing it's parameter before passing it on...
The menu items in the component are resized accordingly, but the vertical height of the menubar itself isn't. (the line seen on the picture below cutting through the icons)
Is there an easy solution to this, like setting some well hidden height property somewhere?
Or do I have to rewrite half of delphi's code to achieve my goal?
Help with code examples are appreciated. :-)
Here's an image:
I am using Delphi 7 on a Win7 machine.
The height of the menu bar is a Windows metric setting. Thus it is valid system wide - not only for your application. If at all, it can only be changed via the display settings of Windows itself.
I would recommend to use TActionMainMenuBar instead. It is much more flexible then the TMainMenu.
You can change the font of the menu bar very easy as well.
I'm using jQuery UI Draggable to drag a <div> whose width is calculated as part of the layout (margin:auto;).
When dragging that element using helper:clone, the clone also gets the margin:auto; style, but is no longer constrained by the original's container.
Result: The cloned <div> may have a different width than the original.
Fiddle: http://jsfiddle.net/ericjohannsen/ajpVS/1/
How can I cause the clone to retain the original's width?
Jon's answer is really good, but it doesn't work properly when you have child elements in the draggable. When that's the case, the event.target can represent your draggable's children, and you'd want to modify the draggable's helper() method something like:
$(".objectDrag").draggable({
helper: function(e) {
var original = $(e.target).hasClass("ui-draggable") ? $(e.target) : $(e.target).closest(".ui-draggable");
return original.clone().css({
width: original.width() // or outerWidth*
});
},
...
});
Without this, the helper would represent any child element clicked within the draggable (click the within the light blue region in the "Drag 1" box for example). Adding the additional logic above ensures that the draggable element is used for the helper. Hope that helps for anyone in a similar situation!
* Note: You'll want to use outerWidth if the original element has box-sizing: border-box applied (thanks to #jave.web for raising).
You just need to set the width and the margin on the cloned element based on the draggable object when it is dropped, using $(ui.draggable).clone().css({ ... });
Here's an updated fiddle for you, should be what you're looking for. It will also keep the width for the helper object as well. http://jsfiddle.net/ajpVS/2/
I think I know what the problem is.. where you have:
<div style="width:50px">
it also needs to be included in the objectDrag class:
<div class="objectDrag" style="width:50px;margin:auto; color:white;border:black 1px solid; background-color:#00A">Drag me</div>
I hope thats what you meant!
EDIT:
Hi took another quick look
http://jsfiddle.net/He2KZ/1/
I used the width:inherit property to inherit the parents width no matter what size it is. Also I noticed removing the border fixed the problem. the dragable clone is 2px out and you have a border of 1px. This is kinda buggy from Jquery-ui IMO they should account for borders at least.
If you really want borders try using "outline" instead of "border". This does not add to the width of the div.
I'd like to bind the Width of my RowDetailsTemplate to the Width of my DataGrid, so that the row details are not surrounded with scroll bars.
Here's the problem:
Notice that the RowDetailsTemplate contains hidden content that must be scrolled into view - which is terrible. The user must drag the scroll bar at the very bottom bottom of the DataGrid in order to see the rest of the row's details - which is very unintuitive. I really want the row details to layout its content such that no scrolling is necessary.
Any suggestions?
Thanks,
Charles
I did find the solution for a similar problem in WPF, you can find it here: DataGrid RowDetails Width problem
I don't know if it works in silverlight, but give it a try.
The answers here felt like a workaround so I did some research and did
find the solution on the Telerik forums, since we use their
RadGridView. Turned out the solution worked for DataGrid as well.
The key is to set the ScrollViewer.HorizontalScrollBarVisibility
property to Disabled, see example below.
<DataGrid ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<DataGrid.RowDetailsTemplate>
<DataTemplate>
<Border>
<TextBlock Foreground="White" Text="{Binding RowDetails}"
TextWrapping="Wrap"/>
</Border>
</DataTemplate>
</DataGrid.RowDetailsTemplate> </DataGrid>
Setting the AreRowDetailsFrozen property on my DataGrid to true solved my problem. Example:
<data:DataGrid AreRowDetailsFrozen="True" />