我正在动态添加一个图像按钮,并尝试将其与父容器的右下角(在其内部)对齐,但该按钮位于容器的左上角(在其外部)
ImageButton Acceptbutton = new ImageButton(getContext());
Acceptbutton.setImageDrawable(getResources().getDrawable(R.drawable.accept));
Acceptbutton.setScaleType(ImageView.ScaleType.CENTER_CROP);
FrameLayout ll = getActivity().findViewById(R.id.imagecalibration);
Acceptbutton.setBottom(ll.getBottom());
Acceptbutton.setRight(ll.getRight());
ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(100,100);
ll.addView(Acceptbutton, lp);