Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a rounded button in FireMonkey?

I'm developing Delphi Firemonkey mobile application. I want to make a rounded button in Firemonkey. How can i do this without using 3rd party components?

like image 985
Kasparov Avatar asked Dec 10 '22 07:12

Kasparov


2 Answers

Use TCornerButton.

This represents a button with customizable corners.

Use the Corners property to choose the corners to be customized and the CornerType, XRadius, and YRadius properties to customize the corners.

like image 162
Duns Avatar answered Dec 22 '22 20:12

Duns


There are a lot of ways to do rounded buttons in FMX. You can use some different components for making buttons like TRectangle.

Personally I use and suggest you to use TRectangle too.

  • Put a TRectangle to your FMX Form.
  • Set your Rectangle1's Height and Width values to 70 (for e.g.)
  • Change XRadius and YRadius values to 35 (it depends on height-width values)

If you want to make more satisfying button, you should change Fill and Stroke properties.

for e.g.

  • Set Fill.Color is #FF0288D1 (to use Hax color code, add 2 FF to first digit)
  • Set Fill.Kind is Solid

If you don't want to use Stroke (Border for Button) Set Stroke.Kind to None.

Also you can add TLabel or TImage component into your Rectangle1 component and be sure that you set Align property well.

like image 34
Abdullah Ilgaz Avatar answered Dec 22 '22 19:12

Abdullah Ilgaz