View Extending Edittext Loses Styles And Is Not Focusable
I try to subclass EditText for convenience reasons (NumberEdit) using kotlin but the rendered View loses most of the EditText properties. The look is that of a TextView and it is n
Solution 1:
I'm not a kotlin expert but if you look at the java source code for edittext you have following:
publicclassEditTextextendsTextView {
publicEditText(Context context) {
this(context, null);
}
publicEditText(Context context, AttributeSet attrs) {
this(context, attrs, com.android.internal.R.attr.editTextStyle);
}
publicEditText(Context context, AttributeSet attrs, int defStyleAttr) {
this(context, attrs, defStyleAttr, 0);
}
publicEditText(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
It doesn't look like you pass the right parameters to the constructor... You pass a lot of 0s and nulls...
Post a Comment for "View Extending Edittext Loses Styles And Is Not Focusable"