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
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: image view won't fill the visible area


slashkyle wrote:

I agree with zmey on avoiding layoutUpdateHandler it's not reliable. (+only updates when a size changes)

DisplayInfo doesn't account for layout changes so to counter that when you go from portrait to landscape simply set any height to DisplayInfo.width and any width to DisplayInfo.height & vice versa. I use this a lot haven't had any caveats


To be fair here the docs do say it is asynchronous and that updates will only be triggered when a size change completes so to say it's unreliable for exactly these reasons doesn't make a whole lot of sense.

Each to their own though whatever works best for you.

 


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
slashkyle
Posts: 820
Registered: ‎10-16-2012
My Device: Red Z10

Re: image view won't fill the visible area

[ Edited ]

I never read the docs on it :smileywink: just skipped to the code part heh.  I marked it off as unreliable because it doesnt update when the control is created (even though its going from nothing to something)  Not saying it can't be useful either

Please use plain text.
Developer
oddboy
Posts: 136
Registered: ‎05-24-2011
My Device: Z30 running 10.2 and Playbook 4GLTE running OS2.1

Re: image view won't fill the visible area

well, seems to be related to rotation of the ImageView.  I tried many/most of the solutions above and just couldn't get it to go.  so i loaded the default NavigationPane project in momentics and threw in an ImageView and loaded up a picture.  size was fine, i.e. filled the avilable area, but rotation was off by 90 degrees.

 

by rotating the ImageView i can get the image oriented correctly, but then it won't fill the available area.

 

in my "real" app, i'm using the same technique... essentially, getting the orientation of the picture from exif data (in c++) and then rotating the ImageView (rather than running a transform on the image data -- kind of cheating i guess).

 

so i guess i'm either stuck with smaller than desired images, or i need to go back and figure out how to do the transform to rotate the image data - which is not exactly what i wanted to do... 

 

thanks everyone!

bron: a cron-like scheduler for BlackBerry 10
http://apps.oddelement.com
Please use plain text.