【发布时间】:2023-03-07 23:45:01
【问题描述】:
所以我有一个 ExpandableListView,基本上我有一些文本(人名),然后我想要在同一行上有一个按钮(如果可能,朝向右侧)。目前,我的 XML 文件中的这段代码在一行上有文本,然后在下一行有按钮,我已经玩过它,但不知道如何在一行上得到它。
LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="55dip"
android:orientation="horizontal"
android:weightSum="1" >
<TextView
android:id="@+id/lblListItem"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="17dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:paddingLeft="?android:attr/expandableListPreferredChildPaddingLeft" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="false"
android:focusableInTouchMode="false"
android:layout_weight="0.8"
android:textSize="11dp"
android:text="Checkout"
android:id="@+id/checkout" />
</LinearLayout>
【问题讨论】:
标签: android xml android-layout button expandablelistview