iphone - Re-using Android layouts -
on iphone context, when add view subview of view, happens our subview handled correctly, because in xib class handling actions. how can achieve on android? since don't have kind of relation between .xml layout , class uses it, how can achieve that?
the main purpose is, example: while having 1 common header , 1 common footer entire application, want add different views "content view" between header , footer.
you can use layout "include" functionality. allows create layout file header , 1 footer, , include these layouts activity's main layout. , if want include header + footer in multiple activities , these layouts have events want handle, create baseactivity handles these events, , have other activities extend baseactivity.
example pseudocode:
title.xml
<linearlayout><imageview/><textview/></linearlayout>
footer.xml
<linearlayout><textview/><textview/></linearlayout>
main.xml
<relativelayout> <include layout="@layout/title"/> <webview /> <include layout="@layout/footer"/> </relativelayout>
Comments
Post a Comment