2012-03-03 4 views
4

내 애플 리케이션을위한 사용자 정의 키보드가있어, 장치 회전 때 크기를 조정할 수 없습니다. 나는 또한 무효화를 호출하려고했습니다 (안드로이드 KeyboardView 회전에 크기 조정되지 않습니다

@Override 
public void onConfigurationChanged(Configuration newConfig) { 
    super.onConfigurationChanged(newConfig); 

    if(mKeyboardView != null) 
     mKeyboardView.invalidateAllKeys(); 
} 

을 : 나는과 같이 다시 그리기 키보드를 강제하기 위해 노력하고있어 내 활동에 http://imgur.com/2hhX8

: http://imgur.com/TsEM9 여기를 : 당신은 내가 여기 무슨 뜻인지 볼 수 있습니다), 그러나 아무 소용이 없습니다.

+0

나는 동일한 문제에 직면하고있다. 해결책을 찾았습니까? –

답변

4

마지막으로 답변을 찾았습니다! 나는 그것이 옳은 것인지 모른다. 그러나 그것은 효과가있는 것처럼 보인다. 다음과 같이 회전 할 때 키보드를 다시 만들어야했습니다.

@Override 
public void onConfigurationChanged (Configuration newConfig) { 

    super.onConfigurationChanged(newConfig); 

    createKeyboard();  
} 

private void createKeyboard() { 

    mKeyboard = new Keyboard(this, R.xml.qwerty); 
    mKeyboardView = (MyKeyboardView) findViewById(R.id.keyboard_view); 
    mKeyboardView.setKeyboard(mKeyboard); 
    mKeyboardView.setOnKeyboardActionListener(new  MyKeyboardActionListener((Activity)this)); 
} 

또한보기의 크기가 조정되지 않은 것이 아닙니다. 그것은이었다. 문제는 키의 크기가 조정되지 않았기 때문입니다.

관련 문제