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