Android Layout editor ConstraintLayout

前端 未结 1 1956
走了就别回头了
走了就别回头了 2020-12-02 02:54

I am running Android Studio (put on latest stabel upgrade the other day. When I use the Layout editor it seems to prefer ConstraintLayout. When I move two widgets (one TextV

相关标签:
1条回答
  • 2020-12-02 03:40

    Please check ConstraintLayout here:

    https://developer.android.com/training/constraint-layout/index.html

    When you drop a view into the Layout Editor, it stays where you leave it even if it has no constraints. However, this is only to make editing easier; if a view has no constraints when you run your layout on a device, it is drawn at position [0,0] (the top-left corner).

    In other words, it means you must add at least one horizontal and one vertical constraint for the view

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