【发布时间】:2020-04-27 00:18:41
【问题描述】:
我正在尝试使用其中一种默认字体在我的 Android 应用程序上设置等宽字体,但它不起作用。我尝试了“Courier New”或“Consolas”,但都没有成功。似乎 UI 根本没有回应我的字体而是大小。
TListViewItem* item2;
while(!myQuery->Eof)
{
item2 = ListView2->Items->Add();
item2->Objects->DetailObject->Font->Family = "Courier New";
item2->Objects->DetailObject->Font->Style = TFontStyles()<< fsBold;
item2->Objects->DetailObject->Font->Size =13;
item2->Text = myQuery->FieldByName("Description")->AsString.Trim();
item2->Detail = " | "+Format("%-5s", OPENARRAY(TVarRec,(myQuery->FieldByName("Unit")->AsString)))+" | "+Format("%7s", OPENARRAY(TVarRec,(myQuery->FieldByName("Qty")->AsString)))+" | "+CurrToStrF(myQuery->FieldByName("Price")->AsCurrency,ffFixed,2)+" | "+Format("%3s", OPENARRAY(TVarRec,(myQuery->FieldByName("Dsc")->AsString)))+"%|"+Format("%4s", OPENARRAY(TVarRec,(CurrToStrF(myQuery->FieldByName("Vat")->AsCurrency,ffFixed,1))))+"%|"+Format("%-20s", OPENARRAY(TVarRec,(myQuery->FieldByName("Notes")->AsString)))+"|";
myQuery->Next();
}
【问题讨论】:
-
这里有 C++Builder 的特定标签。请使用它们而不是 C++ 和 Builder 的单独标签,以便正确识别您的问题。您也不需要在标题中重复标签信息;它很混乱,因为标签已经包含该信息。如果您为正在使用的 C++Builder 的特定版本添加标签可能会有所帮助,因为 FMX 在版本之间经常(有时甚至是剧烈)变化。
标签: listview fonts firemonkey c++builder