【发布时间】:2014-12-18 23:59:53
【问题描述】:
我正在尝试在我的ListView 上方添加某种填充或边距,以便我可以添加我自己的带有图像和按钮的自定义导航栏。我尝试向我的 XML 添加填充和边距,但我的 ListView 似乎仍然从顶部开始。
如何开始我的列表视图低于屏幕顶部大约50p 左右?
布局
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.mycompany.myapp.myActivity"
android:padding="0dp">
<ListView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/theList"
android:paddingTop="44dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/imageView" />
</RelativeLayout>
【问题讨论】:
-
请添加您的布局xml
-
添加一张你拥有什么和想要什么的图片。