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);


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM