语言

Menu
Sites
Language
Item count in Box widget didn't change

Hi all, 

 

I'm developing an image viewer based on the 'Gallery' sample project in Tizen IDE of version 2.3.0 Rev2. 

In order to display images in local storages, I implemented to put vertical box in the scroller widget.

The app makes and inserts same amount of image holders with local images to the box widget at the beginning. 

And it loads all images into the holders after launching and displays images without any problem.

However, some images were not displayed when I modified the project to make and insert image holders at runtime.

And they were appeard when I rotated the device. 

 

For now, I found that item count of the box widget didn't change before device orientation changed.   

I've tried to call elm_obj_box_recalculate when an image was added but all didn't work.

Is there any way to solve this problem?  

编辑者为: Shawn Lee 07 7月, 2015

响应

2 回复
colin Rao

Hi,

I think you should to recalculate the box size by call elm_box_recalculate().

 

Carsten Haitzler

you don't need to reclaculate at all. you can add items to a box at any time and it will queue a recalc (and do so before going idle). if you are manually sizing the box somehow - then that may explain some things. if you put box in scroller, set weight to 0, 0 for it to not expand and align to 0, 0 to be top-left (or 0.5, 0.5 for centered) ... unless you want the box to expand when the scroller does - then set weight in that dir to 1.

this should absolutely work. i have myself done this dozens of times and modified boxes "at runtime".