two or more components as one "big" component
I want to show some information of some objects, let's put an example: cinemas
so, i need 2 or 3 TextView in one "big" component. In this case, first TextView could be cinema name, an开发者_Python百科d secon TextView for the number of films.
I would like to put them like if there was only one, so, onclick events, or while pressing any of them, it would respond like 1 textview (not 2 or 3, with the same sensation of background when you press some button)
is there any way to do this? or just to handle all events i need and fire them for all views?
Thanks in advance!
Sure. Extend a LinearLayout to create a Cinema class, and inflate an xml containing 2 textviews, or whatever you want. Handle all the events inside the Cinema class.
An example.
http://code.google.com/p/myandroidwidgets/source/browse/trunk/Custom_Progress_Bar/src/com/beanie/example/views/MyProgressBar.java
you can just set an onclicklistener on the layout containing all the buttons/views
精彩评论