Add Firemonkey Mobile Styles Into Your Desktop Apps In Delphi 10 Seattle For Android And IOS

Delphi 10 Seattle Mobile Styles On The Desktop Android IOS OSX WindowsDeveloper Marcus Ja came up with a solution for displaying any Firemonkey device style on any other device in Delphi 10 Seattle. In previous versions is functionality was called Mobile Preview and allowed you to see what the IOS or Android style app would look like but in Win32. It is very similar to how IOS Simulator displays an IOS app on the desktop. This is useful because it allows you to create screenshots of your apps for all of the different devices sizes that an App Store needs. You can also see exactly how your app is going to look in IOS or Android from within your Win32 app when using the specified style. Keep in mind the only thing this is doing is skinning the Firemonkey controls with the mobile skin instead of the desktop skin. Native platform controls will still only show up as they would on the platform you are running on. These steps should work with Appmethod and C++Builder as well. Here are the steps he came up with:

1. Open the style designer (add a StyleBook to the form and double click).
2. Load the mobile style you want to use. Located in the public Style folder. It end’s with *.fsf
3. Save it to a location you prefer. (Now the file extension *.style)
4. Open the style in a text editor.
5. Search for the object TStyleDescription and delete the whole section.
6. In your project file (*.dpr) add the unit FMX.Style and at the first code line TStyleManager.SetStyleFromFile(<your style>).

If you want to use these steps with the Premium styles they are already in the .style format so you can just edit them directly without loading them into the TStyleBook first.

Here is what my sample project file looked like after implementing the code:

And here is a sample of the TStyleDescription section below which you can remove to allow styles to work on any device. As you can see the PlatformTarget shows some platform definition information. By deleting it or modifying it you can allow it to run on the other platforms.

More information about working with Firemonkey styles and more example source code about loading your own custom styles in Delphi 10 Seattle is available over in the Delphi documentation.

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Add Firemonkey Mobile Styles Into Your Desktop Apps In Delphi 10 Seattle For Android And IOS by Delphi XE5 XE6 XE7 XE8 10 Seattle Berlin Firemonkey, Delphi Android, Delphi IOS is licensed under a Creative Commons Attribution 4.0 International License.

Leave a Reply

Show Buttons
Hide Buttons
Read previous post:
Delphi 10 Seattle Intel Status Bar Fix Android
Status Bar Issue Fix On Intel Based Android Devices For Firemonkey In Delphi 10 Seattle

The Magnum Labs blog has a post up which contains a RTL fix for your Delphi 10 Seattle apps on...

Close