测量textview的宽度,用于跑马灯效果
获取imageview距离屏幕的距离以及自身宽高信息:
location =new int[2];
// }
mIvMusic.getLocationOnScreen(location);
vto2.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
if (mIvMusic !=null) {
mIvMusic.getViewTreeObserver().removeGlobalOnLayoutListener(this);
width =mIvMusic.getWidth();
height =mIvMusic.getHeight();
网友评论