0

我有一个带有小图像的图像按钮,但是我似乎无法让图像以其实际大小出现在屏幕上。它不断被放大以适应按钮的大小。

我发现一些看起来应该可以解决这个问题的代码,但现在它只是导致图像根本不出现。

我正在以编程方式进行操作,所以这就是我到目前为止所拥有的。

            moreInfo.setImageResource(R.drawable.info);
            moreInfo.setBackgroundDrawable(null);
          //had thought that these lines would have fixed it but just cause nothing to display
                moreInfo.setMaxHeight(20);
                moreInfo.setMaxWidth(20);
                moreInfo.setAdjustViewBounds(true);
         //end of
            moreInfoLP.setMargins(2,2,5,0);
            moreInfo.setLayoutParams(moreInfoLP);
4

0 回答 0