我想在左侧设置图像的位置输入一些EditText views
,但setCompoundDrawablesWithIntrinsicBounds
似乎不起作用。图形似乎没有改变。
有谁知道为什么会这样?
这是我设置可绘制对象的方法:
mFirstname.setCompoundDrawablesWithIntrinsicBounds(R.drawable.user_icon, 0, 0, 0);
mLastname.setCompoundDrawablesWithIntrinsicBounds(R.drawable.user_icon, 0, 0, 0);
mEmail.setCompoundDrawablesWithIntrinsicBounds(R.drawable.mailicon, 0, 0, 0);
mPassword.setCompoundDrawablesWithIntrinsicBounds(R.drawable.lockicon, 0, 0, 0);
mDateOfBirth.setCompoundDrawablesWithIntrinsicBounds(R.drawable.calico, 0, 0, 0);
mCity.setCompoundDrawablesWithIntrinsicBounds(R.drawable.mailicon, 0, 0, 0);
mStreet.setCompoundDrawablesWithIntrinsicBounds(R.drawable.mailicon, 0, 0, 0);
mPostcode.setCompoundDrawablesWithIntrinsicBounds(R.drawable.mailicon, 0, 0, 0);
mPhoneNumber.setCompoundDrawablesWithIntrinsicBounds(R.drawable.mailicon, 0, 0, 0);
最佳答案
如果其他人有这个看似无法解释的问题,请尝试以下操作:
基本上,这部分 View 似乎不会在ICS设备上重新膨胀。希望这可以解决某些人的问题!
关于android - setCompoundDrawablesWithIntrinsicBounds(int,int,int,int)不起作用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/20423445/