1

最初の画像を画面の左側から 20 ピクセル離し、右側の画像を画面の右側から 20 ピクセル離して、さまざまなことを試してみましたが、うまくいきません。

これが私のコードです:

View v = inflater.inflate(R.layout.fragment_hello_moon, parent, false);

    TableLayout tl = (TableLayout)v.findViewById(R.id.l1);
    TableRow tr = new TableRow(getActivity());

    ImageView imageL = new ImageView(getActivity());
    imageL.setImageResource(R.drawable.bell_dl_256);
    imageL.setScaleX((float) 0.50);
    imageL.setScaleY((float) 0.5);

    ImageView imageR = new ImageView(getActivity());
    imageR.setImageResource(R.drawable.bell_dr_256);
    imageR.setScaleX((float) 0.5);
    imageR.setScaleY((float) 0.5);

    tr.addView(imageL);
    tr.addView(imageR);
    tl.addView(tr);

    return v;
4

1 に答える 1