android include中的控件调用


项目中经常会有一些布局是重用的,但是如何来更好的利用这些布局中的控件

转: http://zhidao.baidu.com/link?url=GU93U8Wu31dfp7mKEx52hMJkxjFLCq3WGkvZ8IMrahQT3wgAbC1Y93sKQ36_GQo3V4-Q9KWRHD6RIxMgBYj0zY7YsYNQuGFGjahZsFnz9wq

<include android:id="@+id/view_counter_buttons_1" layout="@layout/view_counter_button_text" 
android:layout_height="fill_parent"  android:layout_width="fill_parent"/>

RelativeLayout lin = (RelativeLayout)findViewById(R.id.view_counter_buttons_1).findViewById(R.id.layout1);

layout1是view_counter_button_text.xml文件里的ID

 


免责声明!

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



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