안드로이드 개발 질문/답변
(글 수 45,052)
열심히 삽질 중입니다. 허허.
뷰의 크기를 먼저 변경해 줘야 한다는 생각에 KeyboardView 의 @onMeasure 을 오버라이딩 했습니다만.
결과는 아래와 같았습니다.
<SoftKeyboard.java>
<dimens.xml>
뷰의 크기를 먼저 변경해 줘야 한다는 생각에 KeyboardView 의 @onMeasure 을 오버라이딩 했습니다만.
결과는 아래와 같았습니다.
<SoftKeyboard.java>
int nKeyboardKeyHeight = ((LatinKeyboard)mInputView.getKeyboard()).getKeyHeight(); //현제 키보드키 높이값 nKeyboardKeyHeight = (int) getApplicationContext().getResources().getDimension(R.dimen.key_height_max) //키높이 변경 값 nKeyboardKeyHeight 에 설정. mCurKeyboard = (LatinKeyboard)mInputView.getKeyboard(); // mCurKeyboard에 키보드 설정 mCurKeyboard.setKeyHeight(nKeyboardKeyHeight); //키보드 키 높이 변경 mInputView.setKeyboard(mCurKeyboard); // 키보드 재설정.
<dimens.xml>
<resources> <dimen name="key_height">50dip</dimen> <dimen name="key_height_max">75dip</dimen> <dimen name="key_height_min">25dip</dimen> </resources>
<LatinKeyboard.java> protect로 설정된 getKeyHeight 와 setKeyHeight 를 오버라이딩함.
@Override public int getKeyHeight() { // TODO Auto-generated method stub return super.getKeyHeight(); }
@Override public void setKeyHeight(int _height) { // TODO Auto-generated method stub super.setKeyHeight(_height);
<LatinKeyboardView.java> // onMeasure 함수를 오버라이딩해서 뷰 싸이즈를 늘려줌.
@Override public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { setMeasuredDimension(MeasureWidth(widthMeasureSpec), MeasureHeight(heightMeasureSpec)); }
키보드뷰의 싸이즈는 늘어 났으나. 키보드 키의 높이는 그대로 입니다.
이상한 점은 Log로 KeyBoard.getKeyHeight 의 높이는 변경이 되었으나, getHeight의 값은 변경이 안되네요. 요게 문제 인듯한데..
조언 부탁드립니다. 그리고 감사합니다!
키보드 뷰어쪽에서 갱신된 keyheight가 적용되지 않는게 아닐까?? 합니다.