Is there any layout which we can use for responsive UI? - maui

I am trying to create one application in which I have one form and table. I tried to use grid but then if I drag the application window then the labels are going to the next line and cutting. If I use stack layout then labels are not rearranged in that case also the labels are not visible so is there anything else which I can use ? Here address and name are in stack layout , and subject is in grid layout

Related

Unity3D. How to move elements inside Vertical Layout Group?

I want to create chat window, and the messages must appears from side. So now I have the system with messages that placed inside of UI element with Vertical Layout Group, but I can't move the messages in horizontal axis, because position of messages is driven by Vertical Layout Group.
I had tried to do it by changing paddings but it works very ugly and I can't add messages into chat window and move them at the same time.
So is there a way to create custom appearance of messages in chat window that driven by Vertical Layout Group?
Instead of putting the labels directly into the VerticalLayoutGroup, put each of them into a seperate container, called ChatLine. ChatLine is just an empty GameObject with a RectTransform. Those ChatLines you put into the VerticalLayoutGroup.
VerticalLayoutGroup
ChatLine
Label
ChatLine
Label
VerticalLayoutGroup will arrange the ChatLine objects, putting one below the other. How you arrange the Labels contained in each of the ChatLines is up to you. You can move them horizontally as you please to create the effect your want.
Vertical Layout Group has its limitations. You can look for more properties in VerticalLayoutGroup class via scripting but most likely you just have to create your own layout so you will have full control on position of every element.

Steps for creating a custom view

How can I create a custom view with a custom style? I have many TextView's in my layout and its kind of difficult to manage all of them. I want to group them in a custom view with custom look (a box with rounded corners) and in my code just give the values to the custom view code to handle it itself.
What I am looking after is something like:
Can someone plesae tell me the steps to create such custom view with rounded box and few TextView's inside it?
Two approaches:
You can create a layout for your view. You need to take different layout widgets like textviews etc. and assign them values.
You can use canvas to draw such view.
The proper way is to inherit from View. Either programatically or in designer You assign any layout to this view. To the layout You assign Your elements ( TextViews, whatever ).
Create methods in the derived View class which fill the inner elements, something like getters/setters, like properties in c#. Those are public.
Then place Your custom compound control onto Your main view.
I for myself created a column orientated tablecontrol with custom scrollbar this way ( but pure via code ) and it works very well. Ah, and additionally You can draw shapes on Your derived view, which allow You relatively simple to apply round corners, and even color transitions.
I'm assuming you're using eclipse to create your android project.
Go to your src file and create a new layout (relative layout works best here). There is a visual representation of the layout you're creating so you should be able to play around with it. Drag and drop the textviews where you want them and give them unique names. Then in your java code, call the textviews like:
TextView text = (TextView) findViewById(R.id.textview_name_here);
text.setText("Your Text Here");
There are plenty of examples online.

In LWUIT, how can i add multiple container/Layout on single Form?

In J2ME I am Using LWUIT library.
My problem is I want to add various component on single Form using different layout or Container. I am looking for some code or example.
Example..
add Header image on top of the Form.
Adding two label, two textfield on
one Container/layout and Two button
on another Container/layout. Design
like Login Form.
add Footer image on bottom of the
Form.
Set the title image of the form for showing header image. Set the softbutton image of the form for showing footer image.
Normally you can use the border layout or box layout for both container and form. See the LWUITDemo application on LWUIT repository. It will helps you. Also see the same sample examples,
The Lightweight User Interface Toolkit (LWUIT): An Introduction
Using LWUIT layouts
use different container with different layout to add in form
i.e set form to Borderlayout add title container to north and footer container to south
next use another container with your required layout and add it to center in form, thus create container hierarchy
For samples on how to arrange components in various layouts you can look within the LWUIT 1.5 distribution and on demos such as the LWUITDemo which has a layouts demo within it. Keep in mind that layouts can be nested.
The LWUIT blog which I maintain contains lots of samples of layout usage.

Vertically add elements to a scrollview: diffs between Java and iPhone SDK?

Folks,
coming from the Java/Swing world, I am sometimes puzzled by the UI programming on the iPhone. I've spent the last hours with Googling for information but it seems that I asked the wrong questions by thinking too much in Java. Could you please point me to resources to get more familiar with the GUI concepts to be able to achive the following functionality:
Basically, I want to create a vertically scrollable view that represents structured text (for example, a recipe). Each step consists of a title and a textual description. As I want to fold and unfold such steps, the title would be somehow interactive and by clicking it the description would be displayed or hidden.
In Java, I would create a component that renders one such section. The layout manager would compute the components preferred height (with or without description being displayed).
Then, in Java, I would create a panel with a vertical layout manager and sequentially add my components. This panel would be placed in a scroll pane; the scroll pane would ask the panel to layout itself and then show a viewport on it, if for example the height is bigger than the scroll pane's height.
What Java provides me is:
layouting of elements (computing their preferred height and width), thus no need to deal with coordinates and dimensions
dynamic creation of UIs by creating and adding components during runtime
What I understood on the iPhone:
I can dynamically add views as subview to a view, e.g. a scrollview by calling addSubview
I can even remove that stuff using removeFromSubview (as explained here Clear content of UIScrollView)
What I don't understand on the iPhone:
does one view always correspond to a visible screen (I did use tab and navbar navigation so far and there whenever I set a new view, it fills the current visible screen minus the space needed for the two bars)?
or is it possible to define a view that contains a label on top ("north") and a text in center; if so, could such a view automatically determine its height?
can I realize my example in a similar way like in Java or would I need to calculate all dimensions and coordinates of the individual components on my own? (This example seems to touch on that topic: iPhone scrollView add elements dynamically with id)
Alternatively, could I use a WebView and render my stuff as local HTML using JavaScript to show or hide nodes?
Thanks for any hint or link!
There are no layout managers in Cocoa, views are being reposition according to their struts and springs settings. For information on that read the documentation: http://developer.apple.com/library/ios/#documentation/DeveloperTools/Conceptual/IB_UserGuide/Layout/Layout.html
To create a "view that contains a label on top and a text in center" you create a view with subviews - one being a label at the top, second the textview in center. If you configure struts/springs for all of subviews properly, they will autoresize when the container view is resized.
You should also get accustomed to Interface Builder, creating views in code is real pain in the ass.

GWT-Ext EditorGridPanel rendering problem

I am using GWT 1.6.4 and GWT-Ext 2.0.6. I am trying to use EditorGridPanel and facing rendering problems.
When the module loads I create a Panel (TopPanel) with BorderLayout and add that to the ViewPort. I then create another Panel (CenterPanel) and add EditorGridPanel, three buttons to the center of the BorderLayout Panel (TopPanel). I tried many layouts for CenterPanel but still not able to get what I want.
I want the table to showup with the required data and scrollbars. All the three buttons comes below the table. The data for the table come via Async call when the module loads, so when the screen is rendered to the user, the data is populated in the table. But looks like the table gets rendered with no data and when the async process finishes the table gets populated but don’t get resized to fit the screen so only show me one row.
The problem is with the Grid, I am not getting any scrollbars. Secondly I don’t want to define the height and width of the Grid. I want it to take as much as possible and show scrollbars, just like we do in html table by setting width and height as 100%.
Thanks
I have found the solution. I had to add the Grid on a panel. I had to set the layout of that panel to FitLayout(). Secondly had to call doLayout() on that panel after loading the Store with the data. I now get the scrollbars for the table as well as it fits the whole available space.