• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps UI development

jfu

Lurker
Hello, I like to write my own ViewClass and have difficulties hereby:
I created a new class which extends android.view.View, now I like to add a TextView element to my class. On Java this was easily doable by passing it to the add() method. - How can I do this with Views?

PS: Please don't suggest xml layouting - I hate it! :D
 
If you want your new view to be a container, try extending ViewGroup instead of view. a ViewGroup is allowed to have children, while a View is not.
 
  • Like
Reactions: jfu
Back
Top Bottom