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
Highlighted
Developer
Posts: 813
Registered: ‎05-29-2012
My Device: see later
My Carrier: see later
Accepted Solution

imageview aspect fill

ImageView {
                id: bannerImage
                objectName: "bannerImage"
                horizontalAlignment: HorizontalAlignment.Center
                verticalAlignment: VerticalAlignment.Bottom
                scalingMethod: ScalingMethod.AspectFit
            }

 

 

Have that imageview, problem is that I bring the imageview from a url.. so aspectfit aspectfill all giving me same results.

i want imageview to take entire height to the top

 

 

import bb.cascades 1.0

Page {
    
    onCreationCompleted: {
        zain.loadImage();
    }
    Container {
        background: Color.create("#52c1b1")
        horizontalAlignment: HorizontalAlignment.Fill
        verticalAlignment: VerticalAlignment.Bottom
        layout: StackLayout {
            orientation: LayoutOrientation.BottomToTop
        }
        preferredHeight: Infinity
        bottomPadding: 25
       
            Label {
                horizontalAlignment: HorizontalAlignment.Center
                verticalAlignment: VerticalAlignment.Bottom
                text: qsTr("loadingApplication")  + Retranslate.onLocaleOrLanguageChanged
                textStyle.base: SystemDefaults.TextStyles.TitleText
                textStyle.color: Color.White
            }
            ActivityIndicator {
                id: activityIndicator
                objectName: "activityIndicator"
                horizontalAlignment: HorizontalAlignment.Center
                verticalAlignment: VerticalAlignment.Bottom
                running: true
            }
            ImageView {
                id: bannerImage
                objectName: "bannerImage"
                horizontalAlignment: HorizontalAlignment.Center
                verticalAlignment: VerticalAlignment.Bottom 
                scalingMethod: ScalingMethod.AspectFit
            }
        }
    
}

 

Retired
Posts: 252
Registered: ‎08-17-2012
My Device: BlackBerry Z10 and Q10
My Carrier: Bell

Re: imageview aspect fill

Hi babakar,

 

As mentioned on this link: "The assigned area of the ImageView is determined by its size parameters." Have you tried to set those parameters for your ImageView to take up the entire height?

@SamarAbdelsayed

Did this answer your question? Please accept post as solution.
Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker