Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
babakar
Posts: 742
Registered: ‎05-29-2012
My Device: see later
Accepted Solution

Preferred Height infinity taking out top of my page

/*
 * Copyright (c) 2011-2013 BlackBerry Limited.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import bb.cascades 1.2

Page {
    Container {
        background: Color.create("#ff0f0000")
        Container {
            preferredWidth: Infinity
            id: contus
             bottomPadding: 20.0
            background: Color.create("#ff0f0000")
            ImageView {
                horizontalAlignment: HorizontalAlignment.Center
                 imageSource: "asset:///images/logo.png"
                 scalingMethod: ScalingMethod.AspectFit
        }
     
    }
    Container {
        preferredWidth: Infinity
        
        background: Color.create("#ffff8400")
        
        Label {
            horizontalAlignment: HorizontalAlignment.Center
            
            // Localized text with the dynamic translation and locale updates support
            text: qsTr("Next Generation Banking")
            textStyle.base: SystemDefaults.TextStyles.TitleText
            textStyle.color: Color.create("#fffffcf6")
        }
    
    }
    Container {
        preferredWidth: Infinity
        topPadding: 200
        bottomPadding: 50
        background: Color.create("#ff0f0000")

        layout: StackLayout {
            orientation: LayoutOrientation.LeftToRight
        }
            Label {
            
            textStyle.textAlign: TextAlign.Center
            horizontalAlignment: HorizontalAlignment.Center
            // Localized text with the dynamic translation and locale updates support
            text: qsTr("Welcome to Al Khaliji ")
            textStyle.base: SystemDefaults.TextStyles.TitleText
            textStyle.color: Color.create("#fffffcf6")
        }
        Label {
           
            
            text: qsTr("Mobile Banking")
            textStyle.base: SystemDefaults.TextStyles.TitleText
            textStyle.color: Color.create("#ffff8400")
        }
    
    }
    Container {
        preferredWidth: Infinity
        background: Color.create("#ff0f0000")
        bottomPadding: 20
        layout: StackLayout {
            orientation: LayoutOrientation.TopToBottom
        }
	    TextField {
	        leftPadding: 20
	        rightPadding: 20
	        horizontalAlignment: HorizontalAlignment.Center
	        preferredWidth: 680
	        hintText: "Username"
	        inputMode: TextFieldInputMode.Text
            

            }
	    TextField {
            leftPadding: 20
            rightPadding: 20
            preferredWidth: 680
            horizontalAlignment: HorizontalAlignment.Center
	        hintText: "Password"
	        inputMode: TextFieldInputMode.Password
	    }
	    Button {
            leftPadding: 20
            rightPadding: 20
            preferredWidth: 680
            horizontalAlignment: HorizontalAlignment.Center
            
            text: "LOGIN"
            
     }
    }
    Container {
        background: Color.create("#ff0f0000")
        preferredWidth: Infinity
        preferredHeight: Infinity
        layout: StackLayout {
            orientation: LayoutOrientation.BottomToTop
        }
        Label {
            
            textStyle.textAlign: TextAlign.Center  
            horizontalAlignment: HorizontalAlignment.Center
            verticalAlignment: VerticalAlignment.Bottom
            // Localized text with the dynamic translation and locale updates support
            text: qsTr("Copyright @2012 Al Khaliji ")
            textStyle.base: SystemDefaults.TextStyles.TitleText
            textStyle.color: Color.create("#fffffcf6")
        }
    }
    }
}

 

 

Okey I have logon on top,  when i do bolded part the logo on top disappears.if  i take out the preferredheight infinity..the logo is back on top..but i dont have my last label "copyright stuff" on bottom of th epage.

Please use plain text.
Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: Preferred Height infinity taking out top of my page

Just a quick comment that your licence agreement at the top is assigning ownership to BlackBerry you need to change it to your name or company.

 

Using Infinity obviously has a roll on effect to connected objects within the scene graph hence my suggestion to use DisplayInfo. I have to leave for a while now but I'm sure someone else will be a long in a minute who has the time to look through the code and help you out.

 

 


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
greenmr
Posts: 882
Registered: ‎03-20-2013
My Device: Red LE Developer Z10

Re: Preferred Height infinity taking out top of my page

Have you tried setting a minHeight for the logo?

 



Developer of Built for BlackBerry certified multiFEED RSS/Atom feed reader and aggregator.
Please use plain text.
Developer
babakar
Posts: 742
Registered: ‎05-29-2012
My Device: see later

Re: Preferred Height infinity taking out top of my page

works, thank you
Please use plain text.