Results 1 to 10 of 10
  1.    #1  
    My new app has a login screen that contains a logo, username, password, and login button. I'd like all of them to center vertically on the screen. I'd tried a couple of different ways without success. Is there a way to do this in webOS?
    MoBill - Use your Authorize.net account to bill your customers with your webOS device!!
    MoJack - Track your lost or stolen webOS device from anywhere!
    Time to get VIRAL
  2. #2  
    Did you try throwing them all in a div with align="center" or something similar?

    I assume CSS would make this really easy, but I have about -1000 experience in CSS.
  3. #3  
    The easiest way you will see will be:

    Code:
    var loginDivObj = this.get("loginDiv");
    loginDivObj.style.marginTop = (Mojo.Environment.maximumCardHeight - loginDivObj.style.height) + "px";
    and hope it will work for what you want. If it does work properly, note that it will work on the Pixi and all future devices.
    Arthur Thornton

    Former webOS DevRel Engineer at Palm, HP, and LG
    Former webOS app developer (built Voice Memos, Sparrow, and several homebrew apps and patches)
    Former blogger for webOS Nation and webOS Roundup
  4.    #4  
    Quote Originally Posted by SirataXero View Post
    Did you try throwing them all in a div with align="center" or something similar?

    I assume CSS would make this really easy, but I have about -1000 experience in CSS.
    That would center horizontally, I'm trying to center vertically...

    Quote Originally Posted by arthurthornton View Post
    The easiest way you will see will be:

    Code:
    var loginDivObj = this.get("loginDiv");
    loginDivObj.style.marginTop = (Mojo.Environment.maximumCardHeight - loginDivObj.style.height) + "px";
    and hope it will work for what you want. If it does work properly, note that it will work on the Pixi and all future devices.
    I'll try this in a bit and post the results! I'm guessing this goes in the activate function?!?!?
    MoBill - Use your Authorize.net account to bill your customers with your webOS device!!
    MoJack - Track your lost or stolen webOS device from anywhere!
    Time to get VIRAL
  5.    #5  
    Didn't work, but I have a feeling this is along the right track. I'll keep trying and post results...
    MoBill - Use your Authorize.net account to bill your customers with your webOS device!!
    MoJack - Track your lost or stolen webOS device from anywhere!
    Time to get VIRAL
  6. #6  
    Quote Originally Posted by Laxidasical View Post
    That would center horizontally, I'm trying to center vertically...
    Good thing I know how to read. >.<.

    My mistake.
  7.    #7  
    Quote Originally Posted by SirataXero View Post
    Good thing I know how to read. >.<.

    My mistake.
    Ha! If you only knew of HALF the times I've misread in the forums you'd take that apology back!!! Sometime I think I'm lexdysic! LOL
    MoBill - Use your Authorize.net account to bill your customers with your webOS device!!
    MoJack - Track your lost or stolen webOS device from anywhere!
    Time to get VIRAL
  8. #8  
    Try this CSS code:

    Code:
    .verticalCentered
    {
        position:absolute;
        top:50%;
        margin-top:-(Half the height of your login box.);
    }
  9.    #9  
    Quote Originally Posted by clacombe View Post
    Try this CSS code:

    Code:
    .verticalCentered
    {
        position:absolute;
        top:50%;
        margin-top:-(Half the height of your login box.);
    }
    I don't this will work because I need to dynamically find the full height of the screen minus the height of the login box which should always be the same.

    I almost have arthurthornton's example working, but there is a very weird error. Maybe one of you can shed some light. First, here is the code with my changes in blue...

    Code:
    var loginDivObj = this.controller.get('loginDiv');
    loginDivObj.style.marginTop = (Mojo.Environment.DeviceInfo.maximumCardHeight - loginDivObj.offsetHeight) / 2 + 'px';
    The very first time I run this after re-installing the app it calculates the div height as 191px. All subsequent app launches are calculated at 278px, which is correct. I can't figure out why the first time is off...anyone???
    Last edited by Laxidasical; 03/16/2010 at 04:34 PM.
    MoBill - Use your Authorize.net account to bill your customers with your webOS device!!
    MoJack - Track your lost or stolen webOS device from anywhere!
    Time to get VIRAL
  10.    #10  
    After more testing it seems that the issue only happens in the emulator and not the device. I'm using the 1.3.1 emulator and have 1.4 on my Pre, so I'm not sure if it's because of the emulator or OS version. Either way, I'm not going to worry about it!
    MoBill - Use your Authorize.net account to bill your customers with your webOS device!!
    MoJack - Track your lost or stolen webOS device from anywhere!
    Time to get VIRAL

Posting Permissions