I'm trying to develop a stock ticker in JDE 4.3.
I found in a recent post that it is possible for two(2) fields to be aligned both horizontal and vertical: Blackberry Field alignment in a VerticalFieldManager.
My question is: is it possible to align horizontally (3) or more ActiveRichTextFields horizontally maybe even five fields? I already have a function that can auto-smooth scroll a VerticalFieldManager
nevermind.. i was using the wrong manager. HorizontalFieldManager does the the trick.
Related
I want to display a text when a specific thing happens in love2d. Everything is working fine except the text displays somewhere away from the center. So i just want to know a way of center aligning text horizontally and vertically. Thanks in advance!
Horizontal aligning works best with love.graphics.printf(). Specify center as the alignment.
Alternatively you can use font:getWidth(text) to get the width required in pixels. love.graphics.getFont() to get the currently active font.
For the height use font:getHeight() or font:getBaseLine(), depending on where the vertical center should be.
I wanna center my Label component in Horizontal Layout (I'm working on navigation bar) but I still want to have hamburger menu button aligned to the left side of the screen,
I tried to use
navbar.setComponentAlignment(myLabel, Alignment.MIDDLE_CENTER);
on my Horizontal Layout but this don't work, it only center in verticaly,
What can I do to achive that?
Vaadin Label is by default 100% wide, so you need to set its width to undefined to center it:
myLabel.setWidthUndefined();
Of course, your HorizontalLayout must be 100% wide (it's undefined by default).
Say, a default EditText is created. It has a default padding around the white editbox.
The default padding at the bottom is larger than the padding on the top.
This means: the center horizontal line of the EditText is not at the center of the white editbox.
If I put a imageView, Align Right and Center Vertical with the EditText, the imageview is not at the center of the white editbox.
I could manually nudge it. But I am afraid it will not apply to all devices.
A better solution?
Thanks!
I would suggest you follow this tutorial, this will achieve what you want and look great at the same time. http://www.wapolabs.com/2012/10/17/android-tip-1-customizing-an-edittext-view/
It is not good practice to put an anything in an edit text but text. Stick with customizing the edit text view as its not hard and keeps good functionality.
and as always set the padding when you customize an edit text to force the text to the exact spot you want it. padding will look fine on all phones.
I am new in BB development,
Please suggest me how i can adjust BitmapFields Width which are in HorizontalFieldManager
to adjust it in Device width.
I am overriding Sublayout method to get this
Now it look like this....I am getting expected o/p for Simulator 9550
Thanks
Create a customBitmapField class which extends BitmapField. Override getPreferredWidth() method and return (Display.getWidth()/3) so the bitmapfield takes up a third of the device display. you will have to handle how it looks in smaller devices as well as the text might not fit.
you can use the PillButtonSet component, you can find it in the advanced UI package.
see here: Advanced UI
Just started testing FireMonkey and can't find a way to make dynamically sized/positioned components.
VCL had the Anchor property, FM does not.
Anybody see something I missed
Update:
Simple anchoring is not available in FM. You have to create TLayouts and align those, then put the controls inside the panel to have them 'stick'. If you used older version of Builder or Delphi, this will be the same as we used to have to do with TPanels.
This is the answer to your question. The anchors property in VCL has apparently been replaced by Margins and Padding (due to performance considerations) and I found some documentation at the XE2 wiki (http://docwiki.embarcadero.com/RADStudio/en/FireMonkey_Application_Design). I doubt if anchors will be put in at a later date. To anchor two buttons (Ok and Cancel) at the bottom of a form on the right side do the following.See images below for the Ok and cancel button.
Place a small panel aligned to the bottom on the form, say about 40 height. Set the 'Margins' on the bottom panel to create a smaller space in which the buttons will live, make sure you set the align the button to alRight. For example the gap between the right edge of the form and the right most button has a margin of 15. The top and bottom margins were set to 12. That anchors the right most button.
'Padding' is the opposite to a margin, the padding puts space outside the control. To the right most button I added a padding of 20 to the left side, this will be the space between the two buttons. For the second button to the left of the first all we need to do is set the align property to alRight, no need to adjust the padding or margins.
Drop multiple TLayout components on the form and configure their alignment properties as desired. Drop other components into these layouts and set their alignment properties relative to the TLayout they are contained in. Seems to be working for me...
Here's the answer you are looking for: FMX controls do not have anchors.
I imagine this will be a "next version" feature.
A quick look at the align property reveals many more choices than we had in previous Delphi versions:
Doesn't that solve your problem (at least partially).
I remember getting by OK for a long time just using nested panels and align to layout stuff.
You can use LiveBindings and expressions to set the properties of your control based on the parent control, though it's a lot of work.
Otherwise, use Margins and Padding (like HTML/CSS).