2017-02-17 65 views

回答

1

将视图作为子视图添加到另一个视图中之后。你应该这样走。

public void someMethod() { 
View parentView; 

View childView = (View)findViewById(R.id.my_view); 
parentView.addView(childView); 

// Now perform your calculations here. which you want to modify for childView. after that just call the invalidate() method to take changes effect. 

parentView.invalidate(); 
} 

希望这会有所帮助。随意告知答案是否与预期不符。

相关问题