This blog post covers two someone unrelated tips related with styles in FireMonkey, specific for XE4.

StyleBook Resources Text Editor

This is a property editor for the textual definition of a StyleBook in FireMonkey I made available on CodeCentral at cc.embarcadero.com/item/29428.

In Delphi XE4, the StyleBook component saves the style information in a binary compressed format in the FMX file, making it more difficult to manually edit the textual description of a style, a feature that was available in Delphi XE3 and previous versions.

This design-time package adds a TStringList editor to the Resources property of the FireMonkey StyleBook component, making it easy to edit the textual representation of a style directly. Consider this an experiment and notice that using StyleBook is not the recommended way to add a custom style: In many cases it is better to create a style file and load it in the StyleManager, rather than embed it in a form.

While we figure out how to clarify StyleBook usage scenarios and update the IDE accordingly, you can take advantage of this simple editor in XE4, regardless of the form platform (from Win32 to iOS).

Pre-Loading Global Styles

An alternative to using a StyleBook component, which is tied to a specific form (and doesn't handle frames), is to act on the global TStyleManager. Given the StyleBook is a visual component, it is very natural for developers to use it, but it is far less optimized. In some circumstances, the controls on a form will be created with the platform default style, and will later be re-created with your custom style. This isn't good, specifically on iOS.

Style loading in the global style manager is documented in docwiki.embarcadero.com/RADStudio/XE4/en/Retina_and_non-Retina_styles_in_FireMonkey_Applications. The methods to call (after referring to the FMX.Styles unit) are:

 
TStyleManager.SetStyleFromFile(filename);
TStyleManager.SetStyleFromFileHiRes(retinaFilename);

What is not obvious from the description is that if you call this method in a form, the style is reapplied. If you call it before the form is created, the custom style will fully replace the platform one. So you can put this code in the project source code, before Application.Initialize, or you can put it in the initialization section of one of the form units. Don't place multiple lines like these in a project, as you can have only one active style in the style manager.