tags:

views:

189

answers:

3

I want to have the title of my application to be freezed, that is, even if I scroll down the page, I want the label name to be in focus, at the top always.. Is that possible?

Now if I scroll down , the screen name disappears. Instead, can it be freezed like freezing columns or rows in excel?

+1  A: 

Have you tried ApplicationControlBar - use it with dock set to true.

Quoting from the linked page:

Docked mode: The bar is always at the top of the application's drawing area and becomes part of the application chrome. Any application-level scroll bars don't apply to the component, so that it always remains at the top of the visible area, and the bar expands to fill the width of the application. To create a docked bar, set the value of the dock property to true.

Amarghosh
I tried like this: ` <mx:ApplicationControlBar dock="true"> <mx:Label styleName="labelHeading" text="Defect Tracker" /> </mx:ApplicationControlBar> ` But still, when I scroll, the label disappears.
Angeline Aarthi
As per the example it works fine,if I add to my component is doesn't work. But I am adding it to a mxml component of the main mxml application. Its a view stack child of the main mxml application. Will this `Application ControlBar` work only in mxml applications and not in mxml component files?
Angeline Aarthi
I'm not sure about other components. I suggested this as you said application in the question. Use @zdmytriv's method - assign a fixed height (not percentage) for the second vbox so that scrolling always applies to that one instead of the external vbox.
Amarghosh
+1  A: 

I don't know if I understand you correct, but I would make it the following way:

<mx:VBox width="100%" height="100%" verticalScrollPolicy="off">
   <mx:Label label="My Title" />
   <mx:VBox name="content">
      ...
   </mx:VBox>
</mx:VBox>

So you'll be scrolling just the second VBox and the outer VBox with the title keeps always on top.

Pesse
Well, I was going for this option in the first case. But wanted to know if there are simpler options by setting some variable. Because sometimes, I get problems by setting the verticalScrollPolicy to off state.
Angeline Aarthi
+1  A: 

Run this:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="100%" height="100%">
    <mx:VBox width="100%" height="100%">
     <mx:Label text="My Label!" />
     <mx:VBox width="100%" height="100%" minWidth="0" minHeight="0">
      <mx:CheckBox label="1" />
      <mx:CheckBox label="2" />
      <mx:CheckBox label="3" />
      <mx:CheckBox label="4" />
      <mx:CheckBox label="5" />
      <mx:CheckBox label="6" />
      <mx:CheckBox label="7" />
      <mx:CheckBox label="8" />
      <mx:CheckBox label="9" />
      <mx:CheckBox label="10" />
      <mx:CheckBox label="11" />
      <mx:CheckBox label="12" />
      <mx:CheckBox label="13" />
      <mx:CheckBox label="14" />
      <mx:CheckBox label="15" />
      <mx:CheckBox label="16" />
      <mx:CheckBox label="17" />
      <mx:CheckBox label="18" />
      <mx:CheckBox label="19" />
     </mx:VBox>
        <mx:Label text="Bottom label here!" />
    </mx:VBox>
</mx:Application>

Set minWidth=0 and minHeight=0 so Vbox is not going to expand.

zdmytriv
ya..that was simple.. to add everythng else except the label in the vbox. Thank you..
Angeline Aarthi
This would fail if Application's height is lesser than vbox's height. Set app height to 300 and see what happens. Set the second VBox's height to a fixed value (< applications height) to fix it.
Amarghosh