When to use Constraint Layout & How to use it efficiently? [closed]

血红的双手。 提交于 2019-12-07 01:31:12

问题


Google recently comes with another layout called ConstraintLayout However, I have few questions which is still very confusing.

I reviewed the talk related with this portion from google IO'16 and got an understanding that it would be really helpful as developer to create flat UI and performance would be better than any other layouts.

Questions:

1. In which case, We should use constraint layout?

2. Does introduction of ContraintLayout means that we should not use LinearLayout,RelativeLayout..etc anymore?

3. What is the efficient way to use ContraintLayout?


回答1:


You probably shouldn't have been so eager to jump on your question here since IO is still going on

I suggest you go watch the session called Android Layouts: a new world (currently not available at time of writing) where they go into detail about ConstraintLayout

ConstraintLayout appears to be an easier way to create layouts without dealing with xml. Constraints layout is based off of RelativeLayout and is not meant to kill off other layouts since they are still very useful.

This being said as @CommonsWare said this is very very new and has no official documentation so its very difficult to come to a real conclusion about it. I would say it is like other layouts where it is usage is going to be based on what you want your design to look like



来源:https://stackoverflow.com/questions/37349058/when-to-use-constraint-layout-how-to-use-it-efficiently

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!