我是一名历史老师,试图为我的班级创建一个“总统事实”应用程序,我的开发经验很少。经过教程后观看教程后,我感到很茫然。
现在我的代码看起来像这样
<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"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="#1C1C1C"
android:cacheColorHint="#1C1C1C"
android:entries="@array/facts"
android:textSize="16sp" >
</ListView>
但这只提供了listview,我无法更改字体大小。我也无法以允许图像标题的方式定位列表。
This is the general layout I am looking for
任何帮助都会很精彩。非常感谢你!
编辑:我知道如何添加元素到/填充我的列表。
答案 0 :(得分:0)
您可以使用以下代码行将listView定位在ImageView(或任何其他视图)下方。
android:layout_below="@+id/your_imageview"
所以你更新的listView看起来像这样
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_below="@+id/your_imageview"
android:background="#1C1C1C"
android:cacheColorHint="#1C1C1C"
android:entries="@array/facts"
android:textSize="16sp" />