同時設置了inputType和gravity或者同時設置singleLine和gravity。
?解決辦法一:(不推薦)
????? ? 1、放棄同時使用singleLine和gravity改為使用maxLength 和 gravity;
2、用numeric代替inputtype
解決辦法二:(推薦)
加入以下代碼:
?
final?WindowManager.LayoutParams?attributes?=?getWindow().getAttributes();??
getWindow().getDecorView().addOnLayoutChangeListener(new?View.OnLayoutChangeListener()?{??
@Override??
public?void?onLayoutChange(View?v,?int?left,?int?top,?int?right,?int?bottom,?int?oldLeft,?int?oldTop,?int?oldRight,?int?oldBottom)?{??
???????????????getWindow().setAttributes(attributes);??
???????????}??
???????});??