Multi-line text-views alignment to their baseline (ConstraintLayout Android Studio)

后端 未结 4 1537
日久生厌
日久生厌 2021-02-19 03:53

I have three TextViews \"hi\", \"x\" and \"Hello World\" which I would like to align in the bottom of the Hello World text (ie hi_x_World)

4条回答
  •  礼貌的吻别
    2021-02-19 04:25

    Use Guideline

    Utility class representing a Guideline helper object for ConstraintLayout. Helper objects are not displayed on device (they are marked as View.GONE) and are only used for layout purposes. They only work within a ConstraintLayout.

    A Guideline can be either horizontal or vertical:

    a) Vertical Guidelines have a width of zero and the height of their ConstraintLayout parent

    b) Horizontal Guidelines have a height of zero and the width of their ConstraintLayout parent

    Widgets can then be constrained to a Guideline, allowing multiple widgets to be positioned easily from one Guideline, or allowing reactive layout behavior by using percent positioning.

    Example

    Code:-

    
    
    
        
    
        
        
    
        
    
    
    

提交回复
热议问题