【发布时间】:2022-01-13 18:58:33
【问题描述】:
我需要按照屏幕截图所示进行操作,但我不明白该怎么做。我尝试联系baseline,但没有成功。
我的代码在这里:
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/rl_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
</RelativeLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/top_layout"
android:layout_width="match_parent"
android:layout_height="150dp"
android:background="@color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/rl_bar">
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/bottom_layout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@color/elegant_black"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/top_layout">
</androidx.appcompat.widget.LinearLayoutCompat>
<de.hdodenhof.circleimageview.CircleImageView
android:src="@color/elegant_black"
app:layout_constraintBaseline_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
我该怎么做?
截图示例:
这是我得到的:
【问题讨论】:
标签: android xml android-linearlayout android-relativelayout android-constraintlayout