这是我的 MailActivity。
public class MailActivity extends ListActivity {
String[] listItems = { "Compose", "Inbox", "Drafts", "Sent" };
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mails);
setListAdapter(new ArrayAdapter(this,
android.R.layout.simple_list_item_1, listItems));
}
}
以及我的XML文件
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF">
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<TextView
android:id="@android:id/empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Empty set"
android:textColor="#000000" />
</LinearLayout>
我得到了白色的背景,但不确定在哪里将前景设置为黑色。我已经尝试在 xml 中设置,但似乎没有帮助。