How can I change the colour of the toolbar in a Fi

2019-09-10 01:55发布

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.

3条回答
够拽才男人
2楼-- · 2019-09-10 02:16

TintColor is the property that you are looking for

查看更多
戒情不戒烟
3楼-- · 2019-09-10 02:20

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.

查看更多
Root(大扎)
4楼-- · 2019-09-10 02:30

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).

查看更多
登录 后发表回答