문제

I want to do something like in iPhone development: reposition controls manually without recreating the whole view. what are pros and cons of this approach?

도움이 되었습니까?

해결책

Hopefully this will be useful for somebody.

if you don't want ro re-create your view on orientation change, the only thing you need is to change corresponding Activity in manifest file like this:

android:configChanges="keyboardHidden|orientation|keyboard"

if you want to reposition controls manually, override onConfigurationChanged and reposition everything you need there

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

    // reposition and/or hide/show controls here
} 
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top