OG_OTT
7 years agoVisitor
Get Poster/image dimensions
I have created my own component by extending "group". I have an image that I put into this group, and I want my brs to capture the width/height of that element so I can start to calculate where to place other components (like Labels) around it... but when I try to do this, I always get widths/heights of '0'.
As such, I have found that if I set an observer on the "loadStatus" and wait until it is ready, I can get the bitmap dimensions. This sounds like a great idea! Now, once I know the image size I can make all the adjustments I need (at least for my situation).
Question: Is this typical or the 'correct' pattern I should be following? Or in RSG, is there an alternative way to set 'relative layout' around an image?
As such, I have found that if I set an observer on the "loadStatus" and wait until it is ready, I can get the bitmap dimensions. This sounds like a great idea! Now, once I know the image size I can make all the adjustments I need (at least for my situation).
Question: Is this typical or the 'correct' pattern I should be following? Or in RSG, is there an alternative way to set 'relative layout' around an image?