What is the difference between HLayout and HStack in smartgwt? - smartgwt

I have been using smartgwt for some time, What is the factor that i have to consider to choose between a Stack and Layout ?

The main difference the two is, if you use HStack, the size of the HStack will be fixed as per the browser window size.
While in case of HLayout, the size given to HLayout is adjusted everytime you resize your browser window.
For more information on this, please visit these links & see the code samples & Overview:
http://www.smartclient.com/smartgwt/showcase/#layout_layout
http://www.smartclient.com/smartgwt/showcase/#layout_stack

Related

iOS: How to display a box of 'tappable tags'

My use-case is like this:
The user defined some tags (text like "#asdf", "#qwerty", "#let_me_think_about_it" and "#decide later"). I want to display these in a box without scrolling (and don't know, how many tags the user created until I display the box).
The box itself should not be scrollable at all but be shown in a UITableViewCell (which is being scrolled). So it must compute the proposed height and respond to Autolayout mechanisms. If a (ARM) Mac user resizes the window to be smaller than before (or an iOS user rotates the device), the box should increase/decrease its height, as necessary (within the limits of Autolayout, since I know of some issues). Each of the tags should be (de)selectable at the same time (UILabel with UITapGestureRegognizer attachted?) and be able to displayed 'selected' (via a background view).
So, the box should primary try to align all content horizontal. If There's not enough horizontal space, do a "line break" and continue on the next "line".
My current solution is a UIScrollView that the user can scroll horizontal and tap any of the (UILabel) views. The displayed views itself are being loaded from a NIB file, like a UITableView does. The issue here is that not any of the selected tags might be visible at the first glance.
If there was no Autolayout, I'd exactly know what to do. But since there it is, I want to use Autolayout in my NIB files and wonder what you would do?
(How do you compute the required width of such a view and decide when a line break is to be done (and how?))
I think I need a simple hint. But if it needs code to explain, ObjC and Swift is both acceptable. :-)
So, the box should primary try to align all content horizontal. If There's not enough horizontal space, do a "line break" and continue on the next "line".
This sounds like a job for UICollectionView with UICollectionViewFlowLayout. You can disable scrolling, and the layout object will tell you the size of the content so that you can adjust the size of the box.
(How do you compute the required width of such a view and decide when a line break is to be done (and how?))
If you're doing it yourself, you add up the widths of all the items on the first line, and if it's larger than the available space, you move the item that extends past the limit and any subsequent items to the next line. Repeat as needed. But that's exactly what a flow layout does for a collection view, so there's no need to roll your own.

Determining height of ScrollView content

I have a Nativescript-Vue application and I'm trying to determine the height of the contained content inside a ScrollView, however when I dump out a variety of height-related properties of the ScrollView both before and after I have changed the sizing of the contained content, there is no difference in the reported heights.
As a bonus question, what I actually care about is determining the state of a contained RadDataForm Picker element (collapsed or expanded) and after having no luck finding anyway to determine this state, I thought I could side-step the issue by looking at the overall height of the RadDataForm which is inside a ScrollView. So if you know how to determine the Picker state, that would be an even better answer.
This is the basic premise of what I've tried:
let view = this.$refs.scrollView.nativeView;
let size = view.getActualSize();
console.dir(size);
console.log(
`ht: ${view.height}, ${view.getMeasuredHeight()}, ${view.effectiveHeight}, ${view.scrollableHeight}, ${view.verticalOffset}`
);
The full test code is at this Playground:
https://play.nativescript.org/?template=play-vue&id=SvC31q&v=3
And the API for the ScrollView is here:
https://docs.nativescript.org/api-reference/classes/_ui_scroll_view_.scrollview
I would expect that you could click the button to dump the height state to the console, click on the country Picker and then click on the button again and see the difference in at least one of those properties, but so far, no joy.
Use scrollableWidth / scrollableHeight on ScrollView to know the actual scrollable width / height.

Text and Image together in a fixed width overflowing-column component in iOS

I want to combine text and images in a view (not using UIWebView) and I want to make the content appear according to the width of the inner view predefined by me. If it's content overflows the content size of that inner view, I want it to overflow to the next view (column right next to the previous one).
Summary: I want to combine both text and images like a newspaper page; fixed width columns all next to each other.
I am trying to create a custom UIScrollView but it becomes more complex in every step and I don't feel safe about this method.
I am using RichTextBlock component in Windows 8 where I can easily add Text or Image objects. I hope to find a similar component but I still haven't.
Are there any other easier methods or ready-to-use libraries made for a similar thing?

Scroll Pane in RoR?

Sorry, probably another silly question, but I've got a lot of information to put onto a pane of my RoR application, how do I implement scroll functionality so if the information is more then what should fit within a fixed pane (say 600 px wide by 600 px down), then a scroll option will automatically be available?
Even better if I can monitor the window size, and if there is more text then window then to automatically enable scrolling both vertically...
I suppose what you need is to style your container element. More to do with CSS rather than Rails
.some-container{width:600px;height:600px;overflow:auto;}

How to customise a the size of the Master is the SPlitviewcontroller?

My master view is a typical table view. But, the cell content is just to the max 5 letters. I wanted to resize the master in my splitview. Is there a way for us to do it?
The docs state "The first pane of a split view controller has a fixed width of 320 points and a height that matches the visible window height. The second pane fills the remaining space.", so it doesn't appear that you can. I'd suggest filing a Radar enhancement request.

Resources