【发布时间】:2020-08-31 19:54:35
【问题描述】:
我正在尝试在线性布局内创建可滚动的卡片视图列表(位于框架布局中),但是我放置的第一个卡片视图位置错误(我希望它位于线性布局的顶部,但它出现在底部)这是一个错误吗?我该如何解决? 这是我的代码:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="417dp"
android:layout_marginTop="5dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/productDetails">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:id="@+id/history_1"
android:layout_width="380dp"
android:layout_height="102dp"
android:layout_marginTop="200dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</LinearLayout>
</ScrollView>
</RelativeLayout>
图片如下: picture
【问题讨论】:
标签: java xml android-studio android-linearlayout