是这样的?
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
ImageView imageView = (ImageView)((Activity) context).findViewById(R.id.list_r);
int imageViewHeight = imageView.getMeasuredWidth();
int parentWidth = MeasureSpec.getSize(widthMeasureSpec);
int parentHeight = MeasureSpec.getSize(heightMeasureSpec);
int final_width = parentWidth - 2*imageViewHeight;
this.setMeasuredDimension(final_width, parentHeight);
Runnable runnable = new Runnable() {
public void run() {
view.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL);
}
};
Handler handler = new Handler();
handler.postDelayed(runnable,1000);
}
是的,更新textview对象,而不是视图。 –
它'工作只是为了第一页,但当时滚动页面,而不是工作 –
更新处理程序时间1000到100 .. –