How can I give focus to a grid in a Windows 10 UWP app? - windows-10

How can I give focus to a grid in a Windows 10 UWP app? It seems like it does not have a focus member.

Layout controls don't provide a focus method.
Only controls deriving from the Control class have a Focus method.
Layout controls (e.g. Grid, StackPanel or Canvas) derive from the Panel class. This class doesn't provide the capability to "focus" something, because the control itself just layouts its child elements.
You could also say, only an UIElement that is also a TabStop can be focused.

Related

How to properly display a focus rectangle in a compact SplitView menu item

I'm building my first Universal Windows Platform (UWP) App and am trying to implement the popular "Hamburger Menu" using the SplitView class.
Inspired by many samples, the items hosted on the SplitView pane are re-styled RadioButton controls, with a vertical highlight-rectangle, an icon and a text. The appearance is similar to that of the Groove app.
I'm now trying to implement navigation and selection using the keyboard, and this now bring a little focus-rect around the items in the SplitView pane. However, since the pane clips its contents when its DisplayMode is either CompactInline or CompactOverlay, the focus rectangle is also clipped, which is not the behavior a user would expect.
Please, can anyone advise on how to property display the focus rectangle in this situation ?
Just an idea, what if you set the width of all radio button's to be same as the CompactPaneLength property of SplitView. The default is 48 DIPs.

Toolbar UI Login - Inbox by Gmail App

I'm looking at different variations of login screens which have material design elements.
I found the Inbox app quite interesting.
The toolbar (action bar) appears to be mid screen. And the (action bar) snaps up to the right position when editing text.
Questions:
Is this a standard behaviour across 5.0?
How do they achieve this?
The UI element you are seeing on the top, playing the role of an ActionBar is actually the Toolbar widget.
A Toolbar is a generalization of action bars for use within application layouts. While an action bar is traditionally part of an Activity's opaque window decor controlled by the framework, a Toolbar may be placed at any arbitrary level of nesting within a view hierarchy. An application may choose to designate a Toolbar as the action bar for an Activity using the setActionBar() method.
You can have multiple toolbars in an Activity. The toolbars can have different heights. The standard height of the toolbar in portrait is 56dp.
Update:
Default height:
Mobile Landscape: 48dp
Mobile Portrait: 56dp
Tablet/Desktop: 64dp
For extended app bars, the height is equal to the default height plus content increment(s).
You can read more from the Material design specification.
For implementing it you just set the layout_height attribute in the layout file. Of course extracting the number as a dimension resource is always a good idea.

JavaFX: Customize the layout of composite standard controls like Accordion or TreeView

While exploring the basic concepts of JavaFX, the following question arose:
Is there a way to customize the layout of composite controls (such as TreeView or Accordion)?
For example, to achieve a horizontal arrangement of child elements or to introduce animations.
Some controls include API for controlling their layout. For example, you can set the orientation of a ListView to Horizontal or Vertical or switch animation on or off in a TitledPane.
You can write your own skins to apply to existing controls and modify their layout.
Public API for control skinning is provided in Java 8.
Use the -fx-skin attribute to change a skin via css.
More details are in the JavaFX wiki control skinning section.
Using custom skins you can completely change the layout and animations for a control. See for instance this carousel skin of a TreeView.

I can't set background in Midlet

Some people say you can't set background in Midlet and use canvas. I used canvas mode and search for add TextFiled I can't do it because canvas is low level UI and drawing textfield
Can help me for set background in Midlet without Canvas?
You can't set Background in Midlet. The reason behind this Midlet is not an Compoment it-self. Midlet is a framework that allows to code for J2ME/Java ME Applications. A Midlet it self holds the the project components like Forms, Canvas TextBox etc.
You can not set background in Midlet, but you can assign a canvas or form to it and set its background.
A Canvas comes in Low level UI, while TextFied is higher level UI, which requires a component like Form for hold it. So you can not draw/put TextField on Canvas.

How to make grid view in j2me

I am very new in j2me. I want to design following type layout and components.
Mean I want to arrange my items in gridview. And after clicking on each item I will move to another form.
I am using simple lcdui. Please suggest me how can I do this. Means how can I arrange these items in gridview and what items should I use here buttons or something else.
You may provide me some suitable links.
In J2ME you have two options for UI: Form and Canvas.
Forms are a very simple way to display information without dealing with the graphical side of things, where Canvas is a blank screen and you need to draw the objects and their behaviors.
There is a third way: the guys at Sun has created a framework called (LWUIT which stands for Light Weight UI Toolkit). This toolkit provides the simplicity of Forms and the UI control of Canvas.
Hope i helped.

Resources