I'm using Delphi XE7 for developing mobile application. And how can I change the colour of the TToolbar component in Firemonkey mobile application? I can not find the option in the Object Inspector. Is there any other option to change the colour of this component. And I'm targeting Android platform.

- 7,181
- 7
- 63
- 111

- 351
- 7
- 26
-
I'm targeting for _Android_ and the component is **TToolBar**. – Work 2 Enjoy - Enjoy 2 Work Mar 04 '15 at 10:53
3 Answers
Method #1: In Firemonkey most components can be contained within most other components. Place a TRectangle inside of your TToolBar component. Align it to Contents. Change the Fill color to the color you want. Change the Stroke.Kind property to None. Done.
Method #2: You can also do this by modifying the style. Drop the TToolBar on the form. Right click it and select Edit Custom Style.... You should see a toolbar1style1: TStyleObject in the Struction window. Find TRectangle in the Tool Palette. Drag and drop the TRectangle onto the toolbar1style1 line in the Structure window. It should add a TRectangle to your style. Set the Align to Contents. Set the Fill color to what you want. Set the Stroke.Kind to None. Apply and Close. Done.
It will create a custom TStyleBook on your form and your Toolbar should be the Fill color. This may be a less cluttered way than the first method. But could conflict with loading Premium styles into the TStyleBook. Therefor I think the first method is more forward compatible and more maintainable.

- 1,246
- 8
- 10
-
-
1You can in Delphi XE7. I tested it again just now. In previous versions you can not. – FMXExpress Mar 06 '15 at 15:41
-
Example source code: http://www.fmxexpress.com/toolbar-background-color-and-scrolling-marquee-demo-for-delphi-xe7-firemonkey-on-android-and-ios/ – FMXExpress Mar 11 '15 at 14:05
TintColor
is the property that you are looking for

- 601,492
- 42
- 1,072
- 1,490

- 1,938
- 1
- 16
- 29
If your target is the Android platform, I think you can use the TintColor property. I have tested the behaviour in Delphi 10.1 Berlin, and it does work correctly. Please note that the TintColor property is currently only available for mobile platforms (iOS and Android).

- 506
- 1
- 9
- 18