// 端末の横幅を元に、3分割した横幅を計算 public int getTanmatsuWidth(int width) { width -= 20; int w = (int)(width/3); Log.d(TAG, "w= " + w); return w; } // 端末の横幅を元に、3分割した横幅を計算 public int getTamatsuHeight(int width) { width -= 20; int width2 = (width/3); int h = (int)(width2/1.618); Log.d(TAG, "h= " + h); return h; }
端末に画像を3つ並べて、間に10dpの隙間がはいることを想定しています。
なんちゃないよ。