- 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:
- 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.
- Add a Toolbar component to your form.
- Create two buttons inside Toolbar.
- Select the two buttons and align to the left.
- Modify the margins to 5 on each property.
- Save your project and run the application for a Windows platform.
- 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.
- 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.
- Finally, add a TLayout component to the center of your form so that it fills the empty area and align it when using Client.
- 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.
推薦閱讀
- 電腦組裝與系統(tǒng)安裝
- Linux系統(tǒng)架構(gòu)與運維實戰(zhàn)
- 操作系統(tǒng)基礎(chǔ)與實踐:基于openEuler平臺
- 精通Linux內(nèi)核開發(fā)
- 曝光:Linux企業(yè)運維實戰(zhàn)
- Ganglia系統(tǒng)監(jiān)控
- 構(gòu)建可擴展分布式系統(tǒng):方法與實踐
- Linux操作系統(tǒng)應(yīng)用編程
- Linux系統(tǒng)安全基礎(chǔ):二進制代碼安全性分析基礎(chǔ)與實踐
- 突破平面3ds Max動畫設(shè)計與制作
- 從實踐中學(xué)習(xí)Windows滲透測試
- Linux操作系統(tǒng)
- Website Development with PyroCMS
- Windows7系統(tǒng)維護百寶箱
- STM32庫開發(fā)實戰(zhàn)指南