- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在编写一个备忘录组件,它需要看起来像老式的终端 session 。这应该非常简单,但 FireMonkey 样式的工作方式似乎使其复杂得令人难以置信。
在非移动 FireMonkey 应用程序中,我可以右键单击控件并选择“编辑自定义样式”。此选项在移动应用程序中不可用。以下是一位 FireMonkey 开发人员给出的原因。
It is support different style on iOS and Android. We cannot run application on Android in iOS style. But when you try to change platform style, automatically we will use it on each target platform. If you want to change default style of fm control, you should put on the form style book and make style in it, or load to stylebook platform style and make changes in it.
Also very important, When you load platform style in style book, You can want that application instance will not have two copy of platform style (one - system in fmx package and other copy in your style book). For it you should to set flag true in TStylebook.UseStyleManager. In this case style in Style book will replace platform style.
好的,所以我认为我需要创建一个自定义样式。如何创建自定义样式以仅覆盖字体和背景属性?
我想我可以像这样重写ApplyStyle 过程。
procedure TMyMemo.ApplyStyle;
var
BackgroundObject: TFmxObject;
begin
inherited;
BackgroundObject := FindStyleResource('content');
if Assigned(BackgroundObject) then
begin
// Change the background color of the background
end;
end;
我如何知道背景对象是什么类型以及我需要更改哪个属性?
当然,更改控件的背景颜色不会这么困难!我是否遗漏了 FM 风格的一些基本内容?
最佳答案
希望您发现此解决方法有用
uses System.UIConsts;
procedure TfPlanJob.mDetailApplyStyleLookup(Sender: TObject);
var Obj: TFmxObject;
Rectangle1: TRectangle;
begin
Obj := mDetail.FindStyleResource('background');
if Obj <> nil then
begin
TControl(Obj).Margins := TBounds.Create(TRectF.Create(-1, -1, -1, -1));
Rectangle1 := TRectangle.Create(Obj);
Obj.AddObject(Rectangle1);
Rectangle1.Align := TAlignLayout.Client;
Rectangle1.Fill.Color := claLightslategrey;
Rectangle1.Stroke.Color := claNull;
Rectangle1.HitTest := False;
Rectangle1.SendToBack;
end;
end;
关于delphi - 在 FireMonkey 中更改 TMemo 的字体和背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19024083/
如何使用 Firemonkey (XE6) 绘制贝塞尔曲线? XE6 wiki 中的文档目前有点稀疏。 最佳答案 以下代码可用于使用 Firemonkey XE6 绘制简单的贝塞尔曲线。创建一个新的
创建自定义 FireMonkey 样式时,您经常会遇到样式对象,例如 TButtonStyleObject,其中包含一个或多个属性(例如 TButtonStyleObject.NormalLink),
我正在努力让 FireMonkey TEdit 嵌套在 FireMonkey TPopup 中来接收键盘输入。桌面和移动项目都会发生这种情况,尽管我对后者感兴趣: 创建一个新的 FMX 项目。 向表单
我使用以下方法向 Treeviewitem 的复选框添加功能。 function TForm.CreateTVObj:TTreeviewItem; var MyCheckbox:TCheckbox
我有个问题。 我用这个简单的代码添加了一个按钮,但它没有编译任何解决方案? unit Unit1; interface uses System.SysUtils, System.Types, Syst
似乎我需要一个项目的帮助。 我有一个例程,该例程将运行时多个TabItem构造到firemonkey中的页面控件上,并且我想在该标签上有一个关闭按钮。 新选项卡上有一个复选框,用于从选项卡的样式器中加
这个问题在这里已经有了答案: How to free a component in Android / iOS (2 个回答) 7年前关闭。 为了灵 active ,不同的框架(如可见的“模块”,可以
我正在使用 Canvas 绘制函数drawrect和filltext在Tbitmap上绘制,但我不希望结果抗锯齿。有人知道该怎么做吗? 使用 OSX 和 Delphi XE3(但如果需要,可以使用 X
FireMonkey 中是否可以有可停靠的表单,因为我已经检查了表单属性,但没有这样的属性可以做到这一点。有什么解决方法可以实现这一点吗? 最佳答案 据我所知,没有内置任何内容,但您自己添加应该不会太
如果您希望 FireMonkey 中网格的同一列中存在不同的单元格控件,该怎么办?单元格控件似乎属于列,但在某些情况下(如属性编辑器),某些行需要复选框,而其他行需要组合框或编辑控件。 提前致谢。 最
我已将 ......\RAD Studio\9.0\Styles 中的几个示例样式作为资源加载到我的项目中,并且“简单地”尝试在运行时加载其中一个。 我正在使用以下代码来尝试执行此操作: var
在我的应用程序中,有一个文本字段,用户可以在其中输入他们的帐户电子邮件。 使用Java,我可以轻松地让 Android 键盘以小写字母开头 EditText text = new EditText(c
我目前正在尝试 Firemonkey 并遇到了这个问题。当我的申请中有多个表格时,我会得到相同数量的项目在我的 Windows 菜单栏中的一个应用程序(参见屏幕截图)。 在常规 VCL 应用程序中,只
我在 Delphi 中有一个程序,可以将图像组件从一个面板拖放到另一个面板,但在这里我对每个图像组件使用“TWincontrol”和“OnStartDrag”事件,并且效果很好,示例代码如下。当我在
我正在寻找一种在 firemonkey 应用程序中缓存全局热键的方法(仅限 Windows,至少目前如此)。经过一番挫折和谷歌搜索后,这应该可以工作:使用 winapi 调用注册热键 Register
Classic VCL question ...但是如何在 FireMonkey 中执行相同的操作? 我有几个标准的TControl,他们可以集中精力... 例如,在某些TEdit中,如果按返回键,我
我们从版本 1 开始就使用 Firemonkey,但仍然发现更新当前在屏幕上可见的组件很困难。在 Firemonkey 中请求重画的“方式”有很多,也许太多了: 应用样式(ApplyStyle 事件)
在 firemonkey 中,我尝试使用圆角矩形制作进度条。最简单的情况是一个矩形(进度条)和其中的第二个矩形(到目前为止的进度)。附上一个简单的例子。 带角的进度条(油漆): 我尝试过以下操作: 让
我正在使用 Delphi Seattle,我的应用程序适用于 Windows 桌面。 我正在尝试更改 TEdit 的字体大小。因此高度也被修改。在设计时一切正常,但当我运行应用程序时,TEdit 会忽
我目前正在尝试开发一个基于 Firemonkey 的项目。我使用 Firemonkey 是因为它的 UI 功能,因为该项目由许多较小的应用程序组成,每个应用程序都有 3D 方面。我目前仅使用 FMX
我是一名优秀的程序员,十分优秀!