I am developing an application for mobile (android and ios) by Delphi xe5.
I am willing to create this UI:
![](https://www.manongdao.com/static/images/pcload.jpg)
I tried TListBox
but image on left and right cant be set.
I tried TListView
but same problem as TListBox
I tried TGrid
with custom column
, The problem of texts and images is solved but I can't create headers of each rows (it hasn't something like colspan)
What I need is to create a custom control and repeat it.
What is the best solution?
Any solution or guide line will be appreciated.
Solution
Thanks @Mike Sutton for answer, this is the result
![](https://www.manongdao.com/static/images/pcload.jpg)
The style here is so different from a standard TListBoxItem style that is probably makes sense to start from scratch, in which case the issues with accessing the default styles become immaterial.
procedure SetFlag1;
var O: TFMXObject;
begin
O := FindStyleResource('flag1'); //StyleName of the item
if O is TImage then
TImage(O).Bitmap.Assign(FFlag1);
end;
Item := TScoreListBoxItem.Create(Self);
ListBox1.AddObject(Item);
Item.Flag1.LoadFromReource ...
...
Here's an idea that I don't have time to test:
Create a descendant of a TListBoxItem
and in that add you two images as normal TImages. I'm pretty sure that a TListBoxItem
can parent an object. You'll have to place the images on the listbox item where you want them. Then whenever you add an item to the listbox item just pass in your own descendant.
(If this doesn't work someone let me know and I'll delete this.)