WinRT Metro WrapPanel render issue - windows-runtime

WrapPanel is not supported by WinRT, as such I am using this code:
http://www.codeproject.com/Articles/24141/WrapPanel-for-Silverlight-2-0
I've found a problem with using this code in a Grid. Any controls rendered in the row after I place the WrapPanel in, render OVER the WrapPanel in the same row.
It's almost as though the Grid doesn't recognise that WrapPanel is rendering content and so all controls in the following rows take it's place.
See image as an example.
Any ideas on how to resolve this?

Seems like the implementation you are using doesn't measure the size of the panel correctly. If the size it returns from a measure pass is 0 then the Grid with RowDefinition Height="Auto" will make a row with a height of 0, so if anything gets rendered in that row that isn't clipped - it will render under the content of the next row. It seems like the WinRT XAML Toolkit version of the WrapPanel ported from Silverlight Toolkit works well for you. Here is the link for anyone else to use it too: http://winrtxamltoolkit.codeplex.com/SourceControl/changeset/view/4d568d4e4c6a#WinRTXamlToolkit/Controls/WrapPanel/WrapPanel.cs

Related

Empty display in browser even when there is an HTML response

I'm using dojo framework to generate HTML page.
But sometimes, the browser is not rendering any display. It's only when I either zoom-in or zoom-out, the data is shown in the browser. And then when I bring the zoom level back to 100%, it continues to show the data.
So could you please explain this behavior and suggest any fix ?
Is it related to viewport or chromeheight values that I'm using to initialize height and width of HTML page ?
Also, could you please help me in understanding the concept of chromeheight ?

Is it possible to use Auto Layout on some View Controllers and Autoresize on others? (Swift 4)

I am trying to use Autoresize on some of my View Controllers Auto Layout on others. Everything looks fine on all device sizes when I use the "View As:" tool in Storyboards. There are no overlaps and everything fits nicely. However, I have Auto Layout Warnings:
Why am I getting these warnings if nothing is clipping or overlapping? And how do I get rid of them?
Well I think you don't need to do any special steps, just try adding auto-layout margins using (control + actions told) storyboard and xCode will automatically handles them separately.
Other controllers that you have made ready using Auto-resizing would not be effected by this.
And new controller you made ready with auto-layout would work fine as well.
Hope this would work out for you.
For reference adding 2 screenshots (both are from same xCode project) for you to be clear of that what I am trying to say...
if you don't want to use auto layout just disable it.
select ViewController in storybored,go to file inspecter -> locate the Interface Builder Document section.uncheck use Autolayout.

Winrt Scrollbar not working

I am trying to use scrollbar (not scrollviewer) in window store application and it seems there is a bug. It doesn't display at all. It occupies the space as per set width but nothing else is visible.
I have set viewport,small change large change maximum etc but nothing working.(code below)
<ScrollBar Orientation="Horizontal" ViewportSize="500" SmallChange="10" LargeChange="20" Maximum="1000" Minimum="20" Height="20" Margin="130,5,433,5" >
</ScrollBar>
I can not use scroll viewer ,so need specific help on scrollbar only.
Please help. its urgent.
See this article:
In WinRT, How to use ScrollBar control as like in WPF
The recommendation is that you use ScrollViewer for Windows Store App. What is your specific need in wanting to use ScrollBar?
Also, the article discusses the behaviour of ScrollBar, which might explain your issue.

How to force invalidation in Flex 4 TextArea component?

I have a TextArea in a mobile application that I want to force invalidation on a certain event. So far I can do this:
myTextArea.width = myTextArea.width + 1;
I know it works because the text area updates correctly.
I've tried to do it "correctly" using the following:
testing.invalidateProperties();
testing.invalidateDisplayList();
testing.invalidateSize();
testing.validateNow();
parentGroup.invalidateProperties();
parentGroup.invalidateDisplayList();
parentGroup.invalidateSize();
parentGroup.validateNow();
None of the previous code works.
The TextArea is using the StageTextAreaSkin.
UPDATE
This seems to work as well as setting the width but is also a hack and also doesn't sync with the rest of the components:
testing.skin.styleChanged("anything");
The only way I've found to force a validation is to call myTextArea.setStyle("anything_here") or myTextArea.skin.setStyle("anything_here"). Note, it may be the fault of the skin, it is a mobile spark skin from the SDK (not my own creation). Better answers are appreciated.

Child content view controller view has wrong bounds size from Storyboard?

This document outline from my sample Storyboard shows what I'm working with.
I have a custom container view controller and two content view controllers connected via embed segues.
Here is the storyboard itself.
ZetaViewController has to create some programmatic views (within ZetaView, of course). I noticed when I was centering these programmatically created views they seemed really off center.
ZetViewController is centering things by examining self.view.bounds.size.height and self.view.bounds.size.width and doing some appropriate arithmetic.
When I added debug logging to ZetaViewController, I noticed that self.view.bounds.size.height and self.view.bounds.size.width had dimensions equal to ContainerView (768 x 1004) and not ZetaView (728 x 637). The Size Inspector in IB confirms these values.
I created a distinctive value for the tag attribute of ZetaView and logged it. ZetaViewController.view really is ZetaView because the tag value confirms it.
So what is going on? Why would ZetaView, shown clearly with smaller dimensions on the Storyboard and in the Size Inspector, show the wrong values in it's properties during run time?
My problem had nothing to do with Storyboards, segues, or custom container view controllers vs content view controllers. It had to do with the new Cocoa Auto Layout features introduced in iOS 5.
My problem arose from inspecting view bounds size in viewDidLoad instead of in viewWillLayoutSubviews. At the time viewDidLoad is called, the view controller's view has not been given its proper size yet. When I moved the code which programmatically centers views to viewWillLayoutSubviews, it worked as I expected. I still leave view creation code in viewDidLoad because viewWillLayoutSubviews is called repeatedly as layout changes.
See also the View Programming Guide for iOS section "Tweaking the Layout of Your Views Manually".
Ok,I'm going to point to an excellent post that I found: (updated)
http://kevindew.me/post/18579273258/where-to-progmatically-lay-out-views-in-ios-5-and
I was having an awful time adding shadow calayers to views after autolayout had done its magic. viewDidLoad, viewWillLoad etc did not have everything correctly laid out.
viewWillLayoutSubviews is called quite a few times and the state isn't fully set up. However... In viewDidLayoutSubviews, finally everything was set up as I expected.