Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

应用沉浸式标题栏时,点击页面抖动问题 #41

Open
akai1203 opened this issue Nov 25, 2021 · 6 comments
Open

应用沉浸式标题栏时,点击页面抖动问题 #41

akai1203 opened this issue Nov 25, 2021 · 6 comments
Labels

Comments

@akai1203
Copy link

应用沉浸式标题栏时,点击页面会出现抖动问题

@KngStr KngStr added the bug label Nov 26, 2021
@KngStr
Copy link
Collaborator

KngStr commented Nov 27, 2021

补充下细节吧,最好是有个demo

@FoxPIM
Copy link

FoxPIM commented Apr 20, 2022

看里面的源代码:
if M is TApplicationEventMessage then
case TApplicationEventMessage(M).Value.Event of
TApplicationEvent.BecameActive: begin
{$IFDEF ANDROID}
// 感谢谭钦的u_Immerse.pas
TFrameView.UpdateStatusBar;
{$ENDIF}
DealForm(Screen.ActiveForm, True);
{$IFDEF ANDROID}
// 临时的方案,暂未深究原因
TThread.CreateAnonymousThread(procedure begin
Sleep(100);
TFrameView.UpdateStatusBar;
Sleep(100);
TFrameView.UpdateStatusBar;
Sleep(100);
TFrameView.UpdateStatusBar;
end).Start;
{$ENDIF}
end;
TApplicationEvent.WillBecomeInactive:
DealForm(Screen.ActiveForm, False);
end;

三次Sleep造成主Form显示时非沉浸式,与全屏显示有个延时,造成界面显示时最上面会有一个白条一闪而过

@FoxPIM
Copy link

FoxPIM commented Apr 20, 2022

这个项目里的浸式标方案并不是完美的,如果第一张Frame界面元素比较复杂,App启动时界面上方状态栏闪动非常明显

@KngStr
Copy link
Collaborator

KngStr commented Apr 20, 2022

对,这个实现本身就比较尴尬。这里如果要解决,就必须找到是为什么调用了这个,或者说导致需要重新刷新。从我找到的信息来看,跟emb的Java部分是有关的。但那个就需要jar补丁了,所以之前没做。@FoxPIM

@FoxPIM
Copy link

FoxPIM commented Apr 20, 2022

你可以看下 https://github.com/viniciusfbb/fmx_tutorials 这个下面的SystemBar项目,它这个相对比较完美,只是发现在Android11下有个Bug,向作者反馈了,没有回应。

@KngStr
Copy link
Collaborator

KngStr commented Apr 20, 2022

@FoxPIM 感谢分享。不过我短期内是没时间搞了。

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants