Drawable drawablenews = getResources().getDrawable(R.drawable.news); drawablenews.setBounds(0, 0, 69, 69);//第一0是距左右边距离,第二0是距上下边距离,第三69长度,第四宽度 rb1.setCompoundDrawables(null, drawablenews, null, null);//只放上面 Drawable drawablesend = getResources().getDrawable(R.drawable.send); drawablesend.setBounds(0, 0, 69, 69); rb2.setCompoundDrawables(null, drawablesend, null, null); Drawable drawablefriend = getResources().getDrawable(R.drawable.friend); drawablefriend.setBounds(0, 0, 69, 69); rb3.setCompoundDrawables(null, drawablefriend, null, null); Drawable drawablemy = getResources().getDrawable(R.drawable.my); drawablemy.setBounds(0, 0, 69, 69); rb4.setCompoundDrawables(null, drawablemy, null, null);
调整drawable的大小
最新推荐文章于 2024-08-12 03:57:45 发布