windowSoftInputMode =“ adjustResize”不适用于半透明操作/导航栏 所以我创建了自定义布局
public class CustomRelativeLayout:RelativeLayout
{
private int[] mInsets = new int[4];
public CustomRelativeLayout(Context context) : base(context)
{
}
public CustomRelativeLayout(Context context, IAttributeSet attrs) : base(context, attrs)
{
}
public CustomRelativeLayout(Context context, IAttributeSet attrs, int defStyleAttr) : base(context, attrs, defStyleAttr)
{
}
public override WindowInsets OnApplyWindowInsets(WindowInsets insets)
{
if (Build.VERSION.SdkInt >= Build.VERSION_CODES.KitkatWatch)
{
//insets.ReplaceSystemWindowInsets(0, 0, 0, insets.SystemWindowInsetBottom);
return base.OnApplyWindowInsets(insets.ReplaceSystemWindowInsets(0,0,0, insets.SystemWindowInsetBottom));
}
else
{
return insets;
}
}
}
,但是显示和隐藏键盘需要花费时间,甚至需要花很多时间来提高布局。如何解决??????
答案 0 :(得分:0)