jjzjj

SelectorView

全部标签

android - 获取对父 ViewGroup 的引用

我通过将形状和handle作为单独的View添加到ViewGroup来创建可缩放的形状。单击处理程序后,如何获取对ViewGroup的引用以便我可以缩放所有内容?handle.getParent()返回空值。我的ViewGroup是以编程方式创建的。publicclassShapeViewextendsViewGroup{privateSelectorViewmSelectorView;publicShapeView(Contextcontext){super(context);RelativeLayout.LayoutParamsp=newRelativeLayout.LayoutP