ConstraintLayout 实现 两个Textview 居

2020-04-24  本文已影响0人  勤劳的蚂蚁
  <android.support.constraint.ConstraintLayout
                            android:id="@+id/cl_data"
                            android:layout_width="match_parent"
                            android:layout_height="@dimen/dimen_92dp"
                            android:visibility="visible"
                            android:background="@color/colorf4f4f4">

                            <View
                                android:id="@+id/bg"
                                android:layout_width="match_parent"
                                android:layout_height="@dimen/dimen_82dp"
                                android:background="@color/color_white"
                                app:layout_constraintLeft_toLeftOf="parent"
                                app:layout_constraintRight_toRightOf="parent"
                                app:layout_constraintTop_toTopOf="parent"></View>

                            <android.support.constraint.Guideline
                                android:id="@+id/guideline"
                                android:layout_width="0dp"
                                android:layout_height="match_parent"
                                android:orientation="vertical"
                                app:layout_constraintGuide_percent="0.5" />

                            <TextView
                                android:id="@+id/tv_left"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:paddingBottom="0dp"
                                android:textColor="@color/colorff5722"
                                android:textSize="@dimen/text16"
                                android:text="--"
                                app:layout_constraintBottom_toTopOf="@+id/tv_left_two"
                                app:layout_constraintLeft_toLeftOf="parent"
                                app:layout_constraintRight_toRightOf="@+id/guideline"
                                app:layout_constraintTop_toTopOf="parent"
                                app:layout_constraintVertical_chainStyle="packed"
                                ></TextView>

                            <TextView
                                android:id="@+id/tv_left_two"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:textColor="#999999"
                                android:textSize="@dimen/text14"
                                app:layout_constraintBottom_toBottomOf="@+id/bg"
                                app:layout_constraintLeft_toLeftOf="parent"
                                app:layout_constraintRight_toRightOf="@+id/guideline"
                                app:layout_constraintTop_toBottomOf="@+id/tv_left"
                                app:layout_constraintVertical_chainStyle="packed"
                                android:text="日均出勤"></TextView>


                            <TextView
                                android:id="@+id/tv_right"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:paddingBottom="0dp"
                                android:textColor="@color/colorff5722"
                                android:textSize="@dimen/text16"
                                app:layout_constraintBottom_toTopOf="@+id/tv_right_two"
                                app:layout_constraintLeft_toLeftOf="@+id/guideline"
                                app:layout_constraintRight_toRightOf="parent"
                                app:layout_constraintTop_toTopOf="parent"
                                app:layout_constraintVertical_chainStyle="packed"
                                android:text="--"
                               ></TextView>

                            <TextView
                                android:id="@+id/tv_right_two"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:textColor="#999999"
                                android:textSize="@dimen/text14"
                                app:layout_constraintBottom_toBottomOf="@+id/bg"
                                app:layout_constraintLeft_toLeftOf="@+id/guideline"
                                app:layout_constraintRight_toRightOf="parent"
                                app:layout_constraintTop_toBottomOf="@+id/tv_right"
                                app:layout_constraintVertical_chainStyle="packed"
                                android:text="日均出勤率"></TextView>


                        </android.support.constraint.ConstraintLayout>
上一篇下一篇

猜你喜欢

热点阅读