是否可以创建类别来为Delphi / FMX中的现有iOS类和控件定义自定义附加方法(如Xcode中,没有子类化?
例如,我想在UIAlertContoller类中更改UILabel的外观,特别是它们的文本对齐方式。在Xcode中,我只需使用新方法为UILabel创建一个neu类别:
@interface UILabel (TextAppearance) @property (nonatomic, assign) NSTextAlignment appearanceAlignment UI_APPEARANCE_SELECTOR;
@end
@ implementation UILabel (TextAppearance)
-(void)setAppearanceAlignment(NSTextAlignment)alignment {
[self setTextAlignment:alignment]; }
-(NSTextAlignment)appearanceAlignment {
return self.textAlignment; }
@end
如何使用Delphi / FMX进行相同操作?