Android - Listview行内容的垂直对齐

标签 android listview row alignment

我无法将 ListView 行的内容垂直居中对齐。

ListView 的屏幕截图:

Screenshot of Listview

Its my Listview row layout

最佳答案

已解决

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_centerVertical="true">

    <Button android:id="@+id/open"
               android:layout_height="wrap_content"
               android:layout_width="wrap_content"
               android:text="Open"
               android:layout_centerVertical="true"
            />

    <CheckBox android:id="@+id/check"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_centerVertical="true"
              android:layout_toRightOf="@id/open"
            />

    <TextView android:text="@+id/label"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:id="@+id/label"
              android:textSize="16px"
              android:layout_toRightOf="@id/check"
            />

</RelativeLayout>

关于Android - Listview行内容的垂直对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9259793/

相关文章:

android - 将我的 res/raw 包中的 mp3 添加到 Android 的铃声列表中

Flutter ListWheelScrollView ,如何添加水平线

ios - Xamarin.Forms(iOS项目):ListView分隔符显示在所有屏幕中

r - 在 R 中按行计算 2 个值之间的 NA 数量

arrays - MATLAB 中每行出现的索引

r - 更改 data.frame 中的单行名称

java - Android Studio : Problems accessing Sub-Item in non activity class

android - AGP版本升级失败

java - 将数据设置为来自一些不同 R.array(XML) 的自定义 ListView 适配器

android - 如何设置 BroadcastReceiver 权限(安全)