package com.newingscom.fpimlauncher.view;
import android.annotation.SuppressLint;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.EditText;
/**
* Created by Administrator on 2019/4/10 0010.
*/
@SuppressLint("AppCompatCustomView")
public class MSEditText extends EditText {
public MSEditText(Context context) {
super(context);
}
public MSEditText(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MSEditText(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected void onSelectionChanged(int selStart, int selEnd) {
super.onSelectionChanged(selStart, selEnd);
if (selStart == selEnd) { // 防止不能多选
setSelection(getText().length()); // 保证光标始终在最后面
}
}
}
光标一直在后面的EditText
猜你喜欢
转载自blog.csdn.net/qq_25430563/article/details/89185771
今日推荐
周排行