BennieC 0 Posted November 6, 2022 Good day I am trying to build an application which requires me to display multiple images in groups with selectable sizes. The images consist of a bitmap and a text field. My idea is to put the image groups in a TListview (Which I hope can display horizontally) and then add these listview groups into a TFlowlayout to manage the screen layout. However, I simply do not get it right to create a TListview item programmatically to display the image. I have tried to create a TListItemImage as well as simply adding a TListViewItem but neither worked in that I could see anything on the screen. I am including my test code (Note it pulls images from a folder for testing). The commented out sections will probably indicate some of the experiments that I tried. I will probably also struggle to add the TListviews to the TFlowlayout. Some advice will be much appreciated. The idea is that the application will run on both Android mobile as well as desktops. prjFlowLO.dpr prjFlowLO.dproj uFlowLOMain.fmx uFlowLOMain.pas Share this post Link to post
Serge_G 87 Posted November 7, 2022 (edited) Hi, 2 solutions. First one is to use a TListView and Dynamic appearance, like this (listview "livebinded" to fdmemtable) In this case, it could be easy to manage groups. pro : if data is in a Table, it's easy to fill with livebindings and easy to manage groups con : if you want different size (possible) you have to code Second one is to use a TScollbox and a TFrame (same design as Item). pro : It's easy to resize a TFrame. In this case, Headergroup should certainly be another frame. con : All is to code Depending of solution you choose, I will explain more if needed Edited November 7, 2022 by Serge_G 1 Share this post Link to post
skyzoframe[hun] 4 Posted November 7, 2022 (edited) 15 hours ago, BennieC said: TListview item programmatically to display the image. Does it mean you want to create at runtime everything? Without using Live bindings? If you want to separately manage Types, Front-End, Back-End. Check the zip file at the bottom. Edited November 7, 2022 by skyzoframe[hun] Share this post Link to post
BennieC 0 Posted November 7, 2022 Indeed, the list items will be created during run time. We have no dataset. Share this post Link to post
Serge_G 87 Posted November 8, 2022 (edited) So I suggest you to use Frames and a ScrollBox (or VertScrollBox or HorzScrollBox) Here my "french" way to do it. But I remember also a some videos of CodeRage 2019 #13 Edited November 8, 2022 by Serge_G 1 Share this post Link to post
BennieC 0 Posted November 15, 2022 I have now used frames and a vertscrollbox and indeed it works well. (Even struggled through the French way of doing it) I would like to use a flow layout and have inserted that into the scrollbox. This seems to work better than me calculating object position as I would have to do in the scrollbox. I do however have a problem with the flowlayout when anchored to the right of the scrollbox and have posted a separate question on that. Share this post Link to post
Serge_G 87 Posted November 15, 2022 55 minutes ago, BennieC said: Even struggled through the French way of doing it 56 minutes ago, BennieC said: I do however have a problem with the flowlayout when anchored When I use ScrollBox and Frames, I never use anchors, preferring to calculate positions of each frame. Why ? I remember a video of a Brazilian guy demonstrating that this way was minus time-consuming Share this post Link to post