Android 使用LinearLayout.getChildAt(i)获取一个线性布局的view,并实现content中实现方法

1、定义接口content的方法,如ok,cancle;
2、在View的处理类myview中实现content的方法。
3、通过contently.getChildAt(i)的方法获得View v;
4、可以使用 content ct = (content)v;
5、使用ct.ok()和ct.cancel();
代码如下:
ll = (LinearLayout) findViewById(R.id.contently);
btncancle = (Button) findViewById(R.id.buttoncancel);
btnok = (Button) findViewById(R.id.buttonok);
View view = (View) ll.getChildAt(0);

原文地址:https://www.cnblogs.com/zhujiabin/p/4384533.html