解决自定义WebView软键盘无法弹出的bug

2018-12-19  本文已影响0人  WotYang

错误构造方法:

public H5WebViewFragment(Context context) { 
    this(context,null,0); 
} 
public H5WebViewFragment(Context context, AttributeSet attrs) { 
    this(context, attrs,0); 
} 
public H5WebViewFragment(Context context, AttributeSet attrs, int defStyleAttr) { 
    super(context, attrs, defStyleAttr); 
    init(); 
}

正确构造方法:

public H5WebViewFragment(Context context) { 
    super(context); 
    init(); 
} 
public H5WebViewFragment(Context context, AttributeSet attrs) { 
    super(context, attrs); 
    init(); 
} 
public H5WebViewFragment(Context context, AttributeSet attrs, int defStyleAttr) { 
    super(context, attrs, defStyleAttr); 
    init(); 
} 

出现这个bug的原因是因为style为0

上一篇 下一篇

猜你喜欢

热点阅读