• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help How to create a topmost window with scroll???

I need to put the ScrollView on top of every other view, so I used WindowManager.AddView as follows
But the scroll function is not working! I cannot scroll the ScrollView...
Could you please teach me how to make the vertical scroll work???? Thank you in advance...

ScrollView mainScrollView =newScrollView(this);
mainScrollView.SetBackgroundColor(Android.Graphics.Color.Red);
mainScrollView.AddView(mainLayout);//mainLayout is all other views inside mainScrollView
var layoutParams =newWindowManagerLayoutParams(700,900,WindowManagerTypes.SystemOverlay,
// WindowManagerFlags.NotFocusable,
WindowManagerFlags.KeepScreenOn,
Android.Graphics.Format.Opaque);
layoutParams.Gravity=GravityFlags.Left|GravityFlags.Top;
IWindowManagerWindowManager=GetSystemService(Context.WindowService).JavaCast<IWindowManager>();WindowManager.AddView(mainScrollView, layoutParams);

But the scroll is not working..... I don't know how to handle this problem......
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones