Dynamic vs XML layout in Android?

后端 未结 7 615
不思量自难忘°
不思量自难忘° 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

提交回复
热议问题