Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7778419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:23:31+00:00 2026-06-01T18:23:31+00:00

In Flex Mobile I have a few buttons in the action bar. On devices

  • 0

In Flex Mobile I have a few buttons in the action bar. On devices with very small screen (such as the HTC Wildfire) not all buttons can be shown. Is there a way to tell Flex to hide an element when it doens’t fit? I know it is possible by using states and test the width of the screen but I hope there is another way..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T18:23:32+00:00Added an answer on June 1, 2026 at 6:23 pm

    Here’s a really simple Spark layout class that lays out the objects horizontally, dropping any items that won’t fit.

    package
    {
        import mx.core.ILayoutElement;
    
        import spark.layouts.supportClasses.LayoutBase;
    
        public class DroppableHorizontalLayout extends LayoutBase
        {
            private static const PADDING:Number = 5;
    
            public function DroppableHorizontalLayout()
            {
                super();
            }
    
            override public function updateDisplayList(width:Number, height:Number):void
            {
    //          super.updateDisplayList(width,height); // super method doesn't do anything
                var currentXCoordinate:Number = 0;
                var numKids:int = target.numChildren;
                for (var i:int=0; i < numKids; i++)
                {
                    var currentItem:ILayoutElement = target.getElementAt(i);
                    var itemWidth:Number = currentItem.getPreferredBoundsWidth();
                    if (currentXCoordinate + itemWidth < width)
                    {
                        currentItem.setLayoutBoundsSize(itemWidth, currentItem.getPreferredBoundsHeight());
                        currentItem.setLayoutBoundsPosition(currentXCoordinate, 0); // or whatever the Y coordinate should be
                        currentXCoordinate = currentXCoordinate + itemWidth + PADDING;
                    }
                    else
                    {
                        break; // no reason to keep iterating, nothing else will fit...
                    }
                }
            }
        }
    }
    

    Writing layouts that have all the functionality of a typical Flex layout class is not trivial. But you can certainly do simple things like the above, to iterate over the child objects, set their size/position, and in this case, not bother rendering things that won’t fit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a view like this in my Flex mobile Application: <s:View xmlns:fx=http://ns.adobe.com/mxml/2009 xmlns:s=library://ns.adobe.com/flex/spark
I'm using Parsley in my flex mobile project. I have multiple destination services but
I have a mobile Flex project which I am deploying to iPhone/iPod and Android.
Refer back to : flex mobile TabbedViewNavigatorApplication back button I have 2 Tabs. Tab1
I am building an mobile flex app in eclipse indigo and have my app
In a Flex Mobile project I have a simple itemRenderer where I'm trying to
I have a list in flex mobile project which contains multiple rows. I want
In a Flex Mobile Application, I have a situation where I need to dynamically
I have a flex android mobile application and I want to implement facebook's SSO.
I have built a OSMF player info my mobile flex application but I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.