android - 当 windowSoftInputMode=“adjustResize” 带有半透明动作/导航栏时,显示和隐藏键盘需要时间
问题描述
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;
}
}
}
但是显示和隐藏键盘需要时间,甚至需要时间来推动布局。怎么解决???
解决方案
推荐阅读
- beautifulsoup - BeautifulSoup:如何从标签中获取文档元素?
- power-automate - Power Automate:从返回的表中获取值
- tree - 使用级别顺序遍历的二叉树顶视图
- performance - Azure AppInsights - 快照调试器 - 应用工作区数据存储解决方案
- json - 返回 json 对象时使用数据表
- git - 有什么方法可以让 git-lfs 不为不在 repo 中的文件下载对象?
- apache-camel - org.apache.camel.CamelExecutionException:在交易所执行期间发生异常:Exchange[ID-02777-NB-1619037740507-0-1]
- csv - 从具有单独表名的文件夹中导入 CSV 文件并从 CSV 文件头创建表头
- c# - 为什么抽象方法需要参数标识符?
- sql - POSTGRESQL 在触发器后插入导致插入记录的 id 不按顺序递增