Dynamic vs XML layout in Android?

后端 未结 7 591
不思量自难忘°
不思量自难忘° 2020-12-06 00:57

I\'m new to Android development and have started creating my own UI. I see that you can either create it dynamically something like this (Dynamic Layouts):

@         


        
相关标签:
7条回答
  • 2020-12-06 01:53

    Well, I declare mu UI in xml (99% of time), becouse it's easier for me to work that way.

    It's good practice to separate UI and Code logic, XML is easier for describing UI (consider using this old designer or switch to Eclipse IDE and it's designer)

    Also, one android app can have multiple designs (for phones and tablets) and it will be painfull to hand-code that in Java

    Simply, use XML

    0 讨论(0)
提交回复
热议问题