【发布时间】:2020-11-19 18:15:55
【问题描述】:
这是 xml 代码。实际上,在运行此代码时,我期望的输出或布局并没有出现,而是显示了一些不同的输出。我还附上了下面输出的屏幕截图。
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.cardview.widget.CardView
android:layout_width="191dp"
android:layout_height="170dp"
app:cardElevation="10dp"
app:contentPadding="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.247"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="35dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="166dp"
android:layout_height="146dp">
<ImageView
android:id="@+id/imageView4"
android:layout_width="151dp"
android:layout_height="108dp"
tools:layout_editor_absoluteX="6dp"
tools:layout_editor_absoluteY="7dp"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/textView15"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="first"
android:textSize="20dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.503"
app:layout_constraintStart_toStartOf="parent"
tools:layout_editor_absoluteY="122dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>
【问题讨论】:
标签: android android-layout android-fragments