You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by chris_d_k <ck...@christiankiefer.de> on 2016/11/03 14:55:27 UTC

Padding above a text in Mobile Air App

I have the case that a label has on one device a huge gap above a number (I
see it when i add some backgroundColor to the label) and on an other device
there is no gap. Can anyone tell me where the problem could be? 

<http://apache-flex-users.2333346.n4.nabble.com/file/n14028/Screenshot_2016-11-03-15-57-27.jpg> 



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Padding-above-a-text-in-Mobile-Air-App-tp14028.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Padding above a text in Mobile Air App

Posted by chris_d_k <ck...@christiankiefer.de>.
The problem is the different positioning. If I add padding the layout in one
case I would have the padding and in the other the padding and the gap.

It should look more or less the same on different devices...

What would help is to get/know/measure the height of the gap to "remove" it,
f.e. by setting the y pos of the label = -GapSize ... or event better to get
the gap removed in any other way...



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Padding-above-a-text-in-Mobile-Air-App-tp14028p14060.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Padding above a text in Mobile Air App

Posted by OK <po...@olafkrueger.net>.
Mabe it's possibilbe to workaround this by adding some padding to the label
or the parent container?

Olaf



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Padding-above-a-text-in-Mobile-Air-App-tp14028p14059.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Padding above a text in Mobile Air App

Posted by chris_d_k <ck...@christiankiefer.de>.
I tested it with Arial -> had the same result :-(



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Padding-above-a-text-in-Mobile-Air-App-tp14028p14058.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Padding above a text in Mobile Air App

Posted by Josh Tynjala <jo...@gmail.com>.
It's probably just the difference between the way that two different fonts
are rendered. _sans only guarantees that it's sans serif, but it's often
different fonts, depending on what's installed, so there's no guarantee
that it will look exactly the same on different devices.

- Josh

On Nov 5, 2016 10:54 AM, "chris_d_k" <ck...@christiankiefer.de> wrote:

> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
> xmlns:s="library://ns.adobe.com/flex/spark" >
>             <s:Label text="0" backgroundColor="0xFF0000" fontFamily="_sans"
> fontSize="32" />
> </s:View>
>
> That's it ... on one device the Number is on the top and on the other it
> has
> a gap above (about half of the size of the number)
>
>
>
> --
> View this message in context: http://apache-flex-users.
> 2333346.n4.nabble.com/Padding-above-a-text-in-Mobile-Air-
> App-tp14028p14053.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Re: Padding above a text in Mobile Air App

Posted by chris_d_k <ck...@christiankiefer.de>.
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" >
            <s:Label text="0" backgroundColor="0xFF0000" fontFamily="_sans"
fontSize="32" />
</s:View>

That's it ... on one device the Number is on the top and on the other it has
a gap above (about half of the size of the number)



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Padding-above-a-text-in-Mobile-Air-App-tp14028p14053.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Padding above a text in Mobile Air App

Posted by Clint M <cm...@gmail.com>.
There are a lot of factors (more so on mobile devices because of dpi) that
could affect the positioning of the label.

If you can post a small example demonstrating the bug... that would help.

On Thu, Nov 3, 2016 at 9:22 AM, chris_d_k <ck...@christiankiefer.de> wrote:

> Sorry... I don't get what you want to say...
>
> There are 2 devices with different font-sizes for each device. The labels
> height ist not set... so measured by flex...
>
> On one device (LG G4C) there is a huge "gap" in the label (top of label to
> to start of the text), on the other there is absolutely no gap
> (XperiaZUltra).
>
>
>
> --
> View this message in context: http://apache-flex-users.
> 2333346.n4.nabble.com/Padding-above-a-text-in-Mobile-Air-
> App-tp14028p14033.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Re: Padding above a text in Mobile Air App

Posted by chris_d_k <ck...@christiankiefer.de>.
Sorry... I don't get what you want to say...

There are 2 devices with different font-sizes for each device. The labels
height ist not set... so measured by flex...

On one device (LG G4C) there is a huge "gap" in the label (top of label to
to start of the text), on the other there is absolutely no gap
(XperiaZUltra).



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Padding-above-a-text-in-Mobile-Air-App-tp14028p14033.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Padding above a text in Mobile Air App

Posted by Clint M <cm...@gmail.com>.
It is most likely this:
"The font size of text (not the text itself) is scaled to match the
resolution."
http://help.adobe.com/en_US/flex/mobileapps/WS19f279b149e7481c682e5a9412cf5976c17-8000.html

On Thu, Nov 3, 2016 at 7:55 AM, chris_d_k <ck...@christiankiefer.de> wrote:

> I have the case that a label has on one device a huge gap above a number (I
> see it when i add some backgroundColor to the label) and on an other device
> there is no gap. Can anyone tell me where the problem could be?
>
> <http://apache-flex-users.2333346.n4.nabble.com/file/
> n14028/Screenshot_2016-11-03-15-57-27.jpg>
>
>
>
> --
> View this message in context: http://apache-flex-users.
> 2333346.n4.nabble.com/Padding-above-a-text-in-Mobile-Air-App-tp14028.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>