1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
// 端末の横幅を元に、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の隙間がはいることを想定しています。
なんちゃないよ。