gpt4 book ai didi

delphi - 为什么所有对话框都使用 "old"Android 2.x 样式?

转载 作者:行者123 更新时间:2023-12-03 15:48:10 29 4
gpt4 key购买 nike

我目前正在使用 RAD Studio XE7,只是想知道为什么我的 Android 应用程序中的所有对话框都使用“旧”2.x 样式?如何强制我的 Android 应用程序在所有对话框(如日期选择器和 MessageDlg)中使用 4.x 样式?

使用样本并修改 AndroidManifest.xml 不起作用。提前致谢。

最佳答案

大卫,我在 Embarcadero Community Answers 上发布了您同一问题的答案站点:

Why all the dialogs are using the "old" Android 2.x style?

I alerted our development team and they found the problem in an Android helper function. Here is the reply from R&D with the workaround:

The fix is very simple : In FMX.Helpers.Android it’s this function

function GetNativeTheme: Integer;
var
LStyleDescriptor: TStyleDescription;
begin
Result := 0;
if not IsGingerbreadDevice and (Screen <> nil) and (Screen.ActiveForm <> nil) and (Screen.ActiveForm.StyleBook <> nil) then
begin
LStyleDescriptor := TStyleManager.FindStyleDescriptor(Screen.ActiveForm.StyleBook.Style);
// GetThemeFromDescriptor(LStyleDescriptor);
Result := GetThemeFromDescriptor(LStyleDescriptor); // <--here the result assignment was missing
end;
end;

这里是 Embarcadero 博客文章,解释如何应用修复:

How to get Android 4.4.x style for your XE7 dialog boxes

In the FMX.Helpers.Android.pas unit, you need to modify the GetNativeTheme function... You will find the original source code unit in the "C:\Program Files (x86)\Embarcadero\Studio\15.0\source\fmx" folder.  Copy the "FMX.Helpers.Android.pas" source file to your project and modify the line to set the return Result. Add the source file to your project in the IDE. Build your app and see the modern dialog boxes on your Android KitKat devices.

关于delphi - 为什么所有对话框都使用 "old"Android 2.x 样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27664134/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com