79443037

Date: 2025-02-16 11:27:33
Score: 2.5
Natty:
Report link

Should anyone arrive here who is struggling with the same problem, I’d like to share the solution I ended up with. Based on the comment from @SilverWarrior, I realised I had to select each OS style and modify the Style Designer there. However, in iOS, the TCornerbutton doesn’t seem to have a background option in the Style Designer. I presume it would be possible to add one using a TRectangle and go from there. I also suspect there is some way of designing it in Windows and then saving and loading this style to other platforms.

However, since I want full control over the appearance of this control, I ended up just making it myself. That is, I used a TRectangle, added a TText and TImage to it, I could then completely customise the look of the TRectangle which would then look consistent over different platforms. In order for click, touch etc events to work, set HitTest to false for all the controls on the TRectangle. The only disadvantage to this approach that I’ve found is that if I duplicate this ‘button’ and then need to change something – say the background color – this has to be done for each individually rather than in the Style Designer. This has turned out to be a good solution for me. (I’ve tested it on the iOS iPhone emulator and an Android phone.)

While there presumably is a way to do this with a TCornerbutton and the Style Designer, there may also be aspects of the design that the platform overrides changes that I might want to make. This way I’ve complete control.

Reasons:
  • RegEx Blacklisted phrase (1): I want
  • Long answer (-1):
  • No code block (0.5):
  • User mentioned (1): @SilverWarrior
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Ian