Apply One FireMonkey Button Style Across Windows, iOS, and Android
Share one custom TButton style across Windows, iOS, and Android using RAD Studio's FireMonkey TStyleBook.
10 Dec 2025, 18:48 UTC

A button that looks like three different apps
You create a FireMonkey multi-device application in RAD Studio, drop a TButton on the main form, and run it. On Windows the button uses the system theme. On iOS it adopts a rounded, gradient look. On Android it picks up Material colors. The code is identical, but the user sees three different products.
FireMonkey is RAD Studio's cross-platform UI framework. It renders controls using styles rather than relying solely on native OS widgets. A style describes the visual template for a control—colors, borders, animations, and layout. When you do not supply one, FireMonkey falls back to platform defaults through StyleServices, the rendering layer that chooses how a control paints itself on each operating system.
Use TStyleBook to define the style once
Instead of writing platform-specific drawing code, add a TStyleBook component to your form. TStyleBook is a container for style resources. Inside it, you define a custom style for TButton and give it a name. Each button then references that name through its StyleLookup property.
If StyleLookup points to a style that exists in the active style book, FireMonkey uses it. If the name is missing or misspelled, the control falls back to the platform default, which is why a typo can make your button suddenly look native again.
Worked example: brand every TButton the same way
- Open RAD Studio and create a new Multi-Device Application (FireMonkey).
- Drop a TStyleBook onto the form. In the Object Inspector, name it BrandStyleBook.
- Double-click BrandStyleBook to open the style designer. Add a TButton style resource, customize its fill, border, and text color, and name the resource BrandButton.
- Close the designer. Set the form's StyleBook property to BrandStyleBook.
- Select each TButton on the form and set StyleLookup to BrandButton.
- Build and run on Windows, then deploy to the iOS simulator and Android emulator.
In Object Pascal, you can switch the active style book at runtime without recreating controls:
Form1.StyleBook := BrandStyleBook;
In C++Builder, assign the form's StyleBook property the same way. Wrap style changes in BeginUpdate and EndUpdate to reduce visual flicker while the control hierarchy repaints.
Where the shared style stops
A custom button style travels with your application bundle, but it does not restyle everything. The operating system status bar, system dialogs, and some native pickers remain outside FireMonkey's style system. On mobile, complex gradients or shadows inside a button style can increase draw time compared with a plain rectangle, though simple fills usually have minimal impact.
Check that it worked
- Launch on Windows and confirm every button uses your custom colors.
- Repeat on the iOS simulator and Android emulator. If a button reverts to the native look, check StyleLookup for spelling and confirm the style resource exists in the active TStyleBook.
- Watch for a flash when changing styles at runtime. If flicker appears, wrap the assignment in BeginUpdate and EndUpdate.
Closing
Define the button style in one TStyleBook, reference it with StyleLookup, and test on each target simulator. You get one branded appearance across Windows, iOS, and Android without maintaining separate UI projects. Accept that system chrome and some mobile rendering costs remain outside your control.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.