소프트 키보드에서 보내기 옵션을 사용하여 여러 줄의 텍스트를 보관하기 위해 Custom EditText를 사용하고 있습니다. 그것은 잘 작동하지만 내 탭 막대는 키보드와 함께 상단으로 이동합니다. 내 매니 페스트 파일에서 다음을 사용했습니다.TabBar가 Custom EditText를 사용하여 소프트 키보드와 함께 이동합니다.
android:windowSoftInputMode="adjustPan"
android:windowSoftInputMode="adjustResize"
정상적인 EditText에서는 정상적으로 작동합니다. 하지만 CustomEditText를 사용하고 있다면 실패합니다.
<com.sample.helpers.CustomEditText
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:hint="Description"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:textSize="16dp"
android:id="@+id/et_description"
/>
내 사용자 지정 글고 클래스 :
public class CustomEditText extends EditText {
public CustomEditText(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
}
public CustomEditText(Context context) {
super(context);
// TODO Auto-generated constructor stub
}
public CustomEditText(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
// TODO Auto-generated constructor stub
}
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
InputConnection connection = super.onCreateInputConnection(outAttrs);
int imeActions = outAttrs.imeOptions&EditorInfo.IME_MASK_ACTION;
if ((imeActions&EditorInfo.IME_ACTION_NEXT) != 0) {
// clear the existing action
outAttrs.imeOptions ^= imeActions;
// set the DONE action
outAttrs.imeOptions |= EditorInfo.IME_ACTION_NEXT;
}
if ((outAttrs.imeOptions&EditorInfo.IME_FLAG_NO_ENTER_ACTION) != 0) {
outAttrs.imeOptions &= ~EditorInfo.IME_FLAG_NO_ENTER_ACTION;
}
return connection;
}
}
스크린 샷 :
이
내 XML이다 0그래서 처리 방법을 안내해주세요.
당신은 어떤 솔루션을 얻었 는가? bcz 나는 또한 같은 문제에 직면하고있다 ...? – Developer
@ 개발자 http://stackoverflow.com/questions/8881324/android-keyboard-puts-tab-bar-on-top –