我正在编写一个自定义视图,从RelativeLayout扩展,我想以编程方式调整它,我该怎么办?
自定义视图类是这样的:
public ActiveSlideView(Context context, AttributeSet attr){
super(context, attr);
LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
if(inflater != null){
inflater.inflate(R.layout.active_slide, this);
}
Run Code Online (Sandbox Code Playgroud)