我可以在Delphi中组合对齐布局吗?

naX*_*aXa 1 delphi layout label alignment firemonkey

我想制作一个占据所有空白空间的标签,同时还有一个居中的文字.

// firemonkey code, 
// causes compile-time error "E2010 Incompatible types: 'TAlignLayout' and 'Set'"
GreedyLbl.Align := [TAlignLayout.alClient, TAlignLayout.alCenter];  
Run Code Online (Sandbox Code Playgroud)

我也在embarcadero wiki上寻找合适的常量,但没有结果.也许有人知道如何制作描述的标签?

Sen*_*ent 6

看起来你很亲密.尝试将其设置Align为just TAlignLayout.alClient.然后设置TextAlign为TTextAlign.taCenter.

该Align物业是其中的一部分,TControl并且在任何时候都有一个视觉方面的控制.

该TextAlign属性仅涉及来自的控件TTextControl,如a TLabel.(另外:TTextControl来自TControl).