Android 開発 viewをリサイズ
やり方をメモ
タイミング
Activity内なら、onWindowFocusChanged(hasFocus=true)いい。 onCreateだと、viewがまだ見えない、取得する幅が0のまま。
カスタマビューを使ってるなら、surfaceCreated(SurfaceViewの場合)でもいい。
設定の仕方
this.getLayoutParams().height = (int) height;
this.getLayoutParams().width = (int) width;