issue with “@id” vs “@+id” in positioning in Relative Layout

前端 未结 3 613
忘掉有多难
忘掉有多难 2020-12-01 23:56

Good day, i have a slight issue with relative layouts and i don\'t know why. Normally when you trying to position relative to other views, you use \"@id\" but it doesn\'t se

3条回答
  •  甜味超标
    2020-12-02 00:05

    After experimenting with ConstraintLayout, check the snippet of code below, both views are wrapped in constraintLayout, i'll just paste the case code:

    
    
            
    

    the line:

     app:layout_constraintTop_toBottomOf="@id/progress"
    

    displays the textview pinned to the top of the view window in the editor, everything look fine in runtime but still this was confusing, now if you write it this way

     app:layout_constraintTop_toBottomOf="@+id/progress"
    

    displays textview below the progress in UI editor as expected, reading through kcoppock explanation i find it matching the case.

提交回复
热议问题