0

I am trying to create a login page with minHeight=600 and minWidth=800. If a user resizes to smaller resolution, only then add scrollbars. I followed tutorial. Code: Main.xml

<?xml version="1.0"?>
<!-- containers\application\AppSparkScroll.mxml -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
           xmlns:mx="library://ns.adobe.com/flex/mx" 
           xmlns:s="library://ns.adobe.com/flex/spark" 
           minWidth="800" minHeight="600"
           width="100%" height="100%"
           backgroundColor="#292929"
           skinClass="skins.CustomApplicationSkin">

<s:Panel title="Login" id="loginPanel" verticalCenter="0" horizontalCenter="0">

    <mx:Form>

        <mx:FormItem label="Username" width="100%">
            <s:TextInput width="100%" id="username" />
        </mx:FormItem>
        <mx:FormItem label="Password" width="100%">
            <s:TextInput width="100%" displayAsPassword="true" id="password" />
        </mx:FormItem>
        <mx:FormItem>
            <s:Button label="Login" id="loginButton" />
        </mx:FormItem>

    </mx:Form>

</s:Panel>

skins.CustomApplicationSkin.mxml

<?xml version="1.0" encoding="utf-8"?>
<!-- containers\application\mySkins\MyAppSkin.mxml -->
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:mx="library://ns.adobe.com/flex/mx" 
    xmlns:s="library://ns.adobe.com/flex/spark">

<fx:Metadata>
    [HostComponent("spark.components.Application")]
</fx:Metadata> 

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

<!-- fill -->
<s:Rect id="backgroundRect" left="0" right="0" top="0" bottom="0">
    <s:fill>
        <s:SolidColor color="0xFFFFFF" />
    </s:fill>
</s:Rect>

<s:Scroller height="100%" width="100%">
    <s:Group id="contentGroup" left="0" right="0" top="0" bottom="0" />        
</s:Scroller>
</s:Skin>
ketan
  • 19,129
  • 42
  • 60
  • 98
Alkesh
  • 61
  • 1
  • 3
  • 9
  • This looks good to me. What issue are you having? – Wade Mueller Jan 18 '11 at 19:38
  • Oh my bad, the issue is that I want scrollbar to appear for screen size less than 800X600 otherwise take up all space, but they dont when I use minHeight, minWeight, height and weight (both set to 100%). – Alkesh Jan 19 '11 at 00:55

2 Answers2

1

Same issue to me, I followed the same tutorial either. Could see the scrollers if I add the horizontalScrollPolicy="on" verticalScrollPolicy="on" to the scroller, but they just don't work even if the browser size is smaller than the content size.

Wildogwyk
  • 13
  • 2
0

In index.html file, within style declaration, paste following code,

html, body  {height:100%; width:100%; min-width:800px; min-height:600px; overflow:auto; position:absolute;}

i hope it should works.Scroll bar should appear if screen size less than 800X600.

Gva
  • 114
  • 3