You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Deepak MS <me...@gmail.com> on 2014/10/09 08:13:47 UTC

Status bar issue in retina display ipad

Hi there,
With iOS 7, there was status bar issue:
https://issues.apache.org/jira/browse/FLEX-33860

It works fine. But when I add a application skinClass, it is failing.

I'm trying to add a simple background image using skinClass at application
level:

<?xml version="1.0" encoding="utf-8"?>
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark">
    <!-- host component -->
    <fx:Metadata>
        [HostComponent("spark.components.Application")]
        [Style(name="bgSource", inherit="no", type="String")]
        [Style(name="bgColor", inherit="no", type="uint")]
    </fx:Metadata>

    <!-- states -->
    <s:states>
        <s:State name="normal" />
        <s:State name="disabled" />
    </s:states>

    <!-- SkinParts
    name=iconDisplay, type=spark.primitives.BitmapImage, required=false
    name=labelDisplay, type=spark.core.IDisplayText, required=false
@Embed('com/imshealth/assets/images/bg.png')
    -->


    <s:Rect width="100%" height="100%">
        <s:fill>
            <s:SolidColor color="{getStyle('bgColor')}"/>
        </s:fill>
    </s:Rect>
    <s:BitmapImage id="img"
                   source="{getStyle('bgSource')}"
                   smooth="true"
                   scaleMode="letterbox"
                   smoothingQuality="high"
                   left="0" right="0"
                   bottom="0" />

    <s:Group id="contentGroup" left="0" right="0" top="0" bottom="0"
minWidth="0" minHeight="0" />
</s:Skin>


I tried changing top and padding. But it isn't working.

So my question is, when we use a skinClass, what change do we need to do in
order to get rid of status bar issue?

Re: Status bar issue in retina display ipad

Posted by Deepak MS <me...@gmail.com>.
Works perfectly! Thank you, Om : )

On Thu, Oct 9, 2014 at 1:47 PM, OmPrakash Muppirala <bi...@gmail.com>
wrote:

> Add this method to your skin class
>
> override public function styleChanged(styleProp: String): void
>         {
>             super.styleChanged(styleProp);
>             var allStyles: Boolean = (styleProp == null || styleProp ==
> "styleName");
>
>             if (allStyles || styleProp == "osStatusBarHeight")
>             {
>                 var osStatusBarHeight: Number =
> Number(getStyle("osStatusBarHeight"));
>                 containerGrp.top = isNaN(osStatusBarHeight) ? 0 :
> osStatusBarHeight;
>             }
>         }
>
> This was the method add to ApplicationSkin [1] to fix the status bar issue.
>
> Thanks,
> Om
>
> [1]
>
> https://github.com/apache/flex-sdk/blob/develop/frameworks/projects/spark/src/spark/skins/spark/ApplicationSkin.mxml
> On Oct 8, 2014 11:14 PM, "Deepak MS" <me...@gmail.com> wrote:
>
> > Hi there,
> > With iOS 7, there was status bar issue:
> > https://issues.apache.org/jira/browse/FLEX-33860
> >
> > It works fine. But when I add a application skinClass, it is failing.
> >
> > I'm trying to add a simple background image using skinClass at
> application
> > level:
> >
> > <?xml version="1.0" encoding="utf-8"?>
> > <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
> >         xmlns:s="library://ns.adobe.com/flex/spark">
> >     <!-- host component -->
> >     <fx:Metadata>
> >         [HostComponent("spark.components.Application")]
> >         [Style(name="bgSource", inherit="no", type="String")]
> >         [Style(name="bgColor", inherit="no", type="uint")]
> >     </fx:Metadata>
> >
> >     <!-- states -->
> >     <s:states>
> >         <s:State name="normal" />
> >         <s:State name="disabled" />
> >     </s:states>
> >
> >     <!-- SkinParts
> >     name=iconDisplay, type=spark.primitives.BitmapImage, required=false
> >     name=labelDisplay, type=spark.core.IDisplayText, required=false
> > @Embed('com/imshealth/assets/images/bg.png')
> >     -->
> >
> >
> >     <s:Rect width="100%" height="100%">
> >         <s:fill>
> >             <s:SolidColor color="{getStyle('bgColor')}"/>
> >         </s:fill>
> >     </s:Rect>
> >     <s:BitmapImage id="img"
> >                    source="{getStyle('bgSource')}"
> >                    smooth="true"
> >                    scaleMode="letterbox"
> >                    smoothingQuality="high"
> >                    left="0" right="0"
> >                    bottom="0" />
> >
> >     <s:Group id="contentGroup" left="0" right="0" top="0" bottom="0"
> > minWidth="0" minHeight="0" />
> > </s:Skin>
> >
> >
> > I tried changing top and padding. But it isn't working.
> >
> > So my question is, when we use a skinClass, what change do we need to do
> in
> > order to get rid of status bar issue?
> >
>

Re: Status bar issue in retina display ipad

Posted by OmPrakash Muppirala <bi...@gmail.com>.
Add this method to your skin class

override public function styleChanged(styleProp: String): void
        {
            super.styleChanged(styleProp);
            var allStyles: Boolean = (styleProp == null || styleProp ==
"styleName");

            if (allStyles || styleProp == "osStatusBarHeight")
            {
                var osStatusBarHeight: Number =
Number(getStyle("osStatusBarHeight"));
                containerGrp.top = isNaN(osStatusBarHeight) ? 0 :
osStatusBarHeight;
            }
        }

This was the method add to ApplicationSkin [1] to fix the status bar issue.

Thanks,
Om

[1]
https://github.com/apache/flex-sdk/blob/develop/frameworks/projects/spark/src/spark/skins/spark/ApplicationSkin.mxml
On Oct 8, 2014 11:14 PM, "Deepak MS" <me...@gmail.com> wrote:

> Hi there,
> With iOS 7, there was status bar issue:
> https://issues.apache.org/jira/browse/FLEX-33860
>
> It works fine. But when I add a application skinClass, it is failing.
>
> I'm trying to add a simple background image using skinClass at application
> level:
>
> <?xml version="1.0" encoding="utf-8"?>
> <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
>         xmlns:s="library://ns.adobe.com/flex/spark">
>     <!-- host component -->
>     <fx:Metadata>
>         [HostComponent("spark.components.Application")]
>         [Style(name="bgSource", inherit="no", type="String")]
>         [Style(name="bgColor", inherit="no", type="uint")]
>     </fx:Metadata>
>
>     <!-- states -->
>     <s:states>
>         <s:State name="normal" />
>         <s:State name="disabled" />
>     </s:states>
>
>     <!-- SkinParts
>     name=iconDisplay, type=spark.primitives.BitmapImage, required=false
>     name=labelDisplay, type=spark.core.IDisplayText, required=false
> @Embed('com/imshealth/assets/images/bg.png')
>     -->
>
>
>     <s:Rect width="100%" height="100%">
>         <s:fill>
>             <s:SolidColor color="{getStyle('bgColor')}"/>
>         </s:fill>
>     </s:Rect>
>     <s:BitmapImage id="img"
>                    source="{getStyle('bgSource')}"
>                    smooth="true"
>                    scaleMode="letterbox"
>                    smoothingQuality="high"
>                    left="0" right="0"
>                    bottom="0" />
>
>     <s:Group id="contentGroup" left="0" right="0" top="0" bottom="0"
> minWidth="0" minHeight="0" />
> </s:Skin>
>
>
> I tried changing top and padding. But it isn't working.
>
> So my question is, when we use a skinClass, what change do we need to do in
> order to get rid of status bar issue?
>