【发布时间】:2021-02-24 11:17:36
【问题描述】:
我尝试在蚀刻线上将所有回收视图元素对齐 2,但它们仅垂直对齐线上的一个元素。
这是我的代码:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="2"
android:orientation="horizontal">
<androidx.cardview.widget.CardView
android:id="@+id/card_pdf"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="12dp"
android:layout_marginBottom="12dp"
android:layout_weight="1">
<TextView
android:id="@+id/tv_pdf_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="ceva"
android:textSize="25sp"
android:padding="6dp"/>
</androidx.cardview.widget.CardView>
</LinearLayout>
【问题讨论】:
标签: android xml android-linearlayout orientation