Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Highlighted
Developer
Posts: 163
Registered: ‎01-30-2013
My Device: Blackberry 10 Simulator
Accepted Solution

problems aligning ImageView and Label

Hello,

 

I have a container with LayoutOrientation.LeftToRight orientation.

Inside it I just have a ImageView and Label. When I try to arrange them

that the icon and the text show on the same line, I have problems.

Here is how it looks like by default (without any padding etc.):

 

screenshot.png

 

(the container - green - may have a bit more space below

the "text" just it is not visible on this image anymore).

 

I think you all see my problem. The image starts right of the

edge of the container (it is aligned to its top edge), while there is some

space between the label and the container top edge.

 

I want the image and label to appear seemingly on the same horizontal

line. How can I achieve this???

 

ps. If I set topPadding of container to something, then both components

will go down simultaneously and still they won't be visible on the same line.

 

Thank you.

 

 

Developer
Posts: 163
Registered: ‎01-30-2013
My Device: Blackberry 10 Simulator

Re: problems aligning ImageView and Label

I think I found the solution by setting   verticalAlignment: VerticalAlignment.Center
 to the ImageView for example.