2014-04-10 16 views
1

我有一個初始化查看如何從視圖中獲取AttributeSet對象?

View v = new View (this); 
v.setLayoutParams(new LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT)); 

我想通過這個觀點的方法說METHOD(View v)後來需要的AttributeSet

我有後,我已經定義爲重新傳遞值。

Method(View v , int Width , int height) 

有什麼辦法從視圖中獲取AttributeSet對象。

v.getWidth();v.getHeight();不工作。

回答