Aligning baseline of two text views in Android

前端 未结 4 868
轻奢々
轻奢々 2021-02-18 18:49

please find below my layout & its result ; I need the text \'Text message\' to align on the baseline of the text \'Header\'(Please find bel

相关标签:
4条回答
  • 2021-02-18 19:15

    For ConstraintLayout just use this↓ to align to another textView baseline:

    app:layout_constraintBaseline_toBaselineOf="@+id/textView"
    
    0 讨论(0)
  • 2021-02-18 19:23

    Use RelativeLayout as a container for TextViews and add the attribute

    android:layout_alignBaseline="@+id/title"
    

    to id/language TextView

    0 讨论(0)
  • 2021-02-18 19:26

    On Component tree select both component you want to be in same base, right click and then select show baseline. Just drag baseline of two components.

    0 讨论(0)
  • 2021-02-18 19:28

    Just use the android:gravity="bottom" on LinearLayout(The linear with the both textviews) and android:layout_height="wrap_content" in both TextViews.

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