Android 安卓Popupwindow没有';当键盘出现API 26(三星S8)时,t更新在正确位置
当键盘出现时,我面临三星S8设备的弹出窗口更新问题。在我的示例editText中,它位于屏幕的底部,弹出窗口将出现在editText的顶部。但当editText聚焦时,弹出窗口不会出现在正确的位置。(仅在API 26中)。对于所有其他设备,它可以按预期工作 复制步骤: 1) 焦点编辑文本(仅S8 API 26) 2) 更改文本 3) 编辑文本上方不显示弹出窗口 代码Android 安卓Popupwindow没有';当键盘出现API 26(三星S8)时,t更新在正确位置,android,xamarin.android,Android,Xamarin.android,当键盘出现时,我面临三星S8设备的弹出窗口更新问题。在我的示例editText中,它位于屏幕的底部,弹出窗口将出现在editText的顶部。但当editText聚焦时,弹出窗口不会出现在正确的位置。(仅在API 26中)。对于所有其他设备,它可以按预期工作 复制步骤: 1) 焦点编辑文本(仅S8 API 26) 2) 更改文本 3) 编辑文本上方不显示弹出窗口 代码 是否有解决此问题的方法。有解决此问题的方法吗?我最近在同一台设备上遇到了相同的问题,但在运行Unity3D时遇到了相同的问题。我非
是否有解决此问题的方法。有解决此问题的方法吗?我最近在同一台设备上遇到了相同的问题,但在运行Unity3D时遇到了相同的问题。我非常乐意在这里获得更多的见解。
EditText editText;
PopupWindow popupWindow;
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
LinearLayout linearLayout = new LinearLayout(this){Orientation=Orientation.Vertical};
editText = new EditText(this) { Text = "TestEditText" };
editText.TextChanged+= EditText_TextChanged;
RelativeLayout relativeLayout = new RelativeLayout(this);
relativeLayout.LayoutParameters = new Android.Views.ViewGroup.LayoutParams(Android.Views.ViewGroup.LayoutParams.WrapContent, Android.Views.ViewGroup.LayoutParams.WrapContent);
relativeLayout.AddView(editText);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(1000, 150);
layoutParams.SetMargins(0, 1400, 0, 0);
editText.LayoutParameters = layoutParams;
linearLayout.AddView(relativeLayout);
popupWindow = new PopupWindow(this);
LinearLayout linearLayoutnew = new LinearLayout(this);
linearLayoutnew.AddView(new TextView(this) { Text = "Testing Popup window behavioor with S8 devices" });
linearLayoutnew.AddView(new Button(this) { Text = "TestButton" });
linearLayoutnew.LayoutParameters = new Android.Views.ViewGroup.LayoutParams(300, 200);
popupWindow.Height = 200;
popupWindow.ContentView = linearLayoutnew;
SetContentView(linearLayout);
}
void EditText_TextChanged(object sender, Android.Text.TextChangedEventArgs e)
{
popupWindow.ShowAsDropDown(editText, 0, -(editText.Height + popupWindow.Height));
}