官术网_书友最值得收藏!

  • Delphi Programming Projects
  • William Duarte
  • 347字
  • 2021-06-24 14:27:07

Creating responsive layouts

In this topic, you will learn how to work with responsive layouts in Delphi using FireMonkey (FMX). For the examples, we will use Delphi Tokyo. Let's have a look at the required steps:

  1. To start, open Delphi and create a new project by navigating to File | New | Multi-Device Application-Delphi and select Blank Application:

Adjust the style for Android; for example, for the view, we will continue in the Master view.

Give preference to working in the Master view. During development, if you want to modify views and add new controls to your form, the responsiveness properties will not be inherited. For example, when adding a TButton component to a 4-inch Android view, properties will be lost if you create to modify for a different view, such as iPhone. In the Master view, all the characteristics will be kept, keeping their proportions clear, by the platform.
  1. Add a Toolbar component to your form.
  2. Create two buttons inside Toolbar.
  3. Select the two buttons and align to the left.
  4. Modify the margins to 5 on each property.
  5. Save your project and run the application for a Windows platform.
  6. Then, select the first button that is already configured and modify the StyleLookup property by selecting the cameratoolbutton option. Notice that the button icon is then changed to a specific camera icon.
  7. Add another Toolbar component, but leave it with bottom alignment. In this toolbar, add a button, align it to the right, and change its margins to 5, as in the top buttons. This button will exit the application.
  8. Finally, add a TLayout component to the center of your form so that it fills the empty area and align it when using Client.
  9. Also, modify StyleLookup for the missing buttons. For the button next to the camera, select searchtoolbutton, because, through this, we will search the already-saved images in the device. For the last button, select escapetoolbutton in the StyleLookup property, because, with this button, we will leave the application.
主站蜘蛛池模板: 正阳县| 光泽县| 筠连县| 凌云县| 绥化市| 芜湖县| 常州市| 西城区| 香港 | 红原县| 镇安县| 泰兴市| 武汉市| 呼玛县| 邻水| 日照市| 太湖县| 安溪县| 汽车| 临高县| 富平县| 德格县| 赣州市| 柞水县| 金坛市| 滨州市| 巴里| 佛冈县| 扶沟县| 镇安县| 游戏| 南安市| 松潘县| 稻城县| 灵武市| 孝昌县| 行唐县| 七台河市| 虞城县| 永善县| 屯留县|