Site icon 咖啡偶-IT日常

Android ConstraintLayout 如何置中

請參考紅色部份

<android.support.constraint.ConstraintLayout 
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        ...>
  <textview ...>
  app:layout_constraintTop_toTopOf="parent"
  app:layout_constraintBottom_toBottomOf="parent"
  </textview>

</ConstraintLayout>
Exit mobile version