您的位置:首页 > 其它

把 Activity 改成 ListActivity继续使用 setContentView

2014-07-30 10:45 211 查看
ListActivity has a default layout that consists of a single, full-screen list in the center of the screen. However, if you desire, you can customize the screen layout by setting your own view layout with setContentView() in onCreate(). To do this, your own view MUST contain a ListView object with the id "@android:id/list" (or list if it's in code)

在Main的<listvie定义的时候,需要写一个系统知道的名字, id "@android:id/list" 。否则系统就找不到。

ListActivity中setContentView()传入的layout中必须有一个id为android:list的ListView

去掉ListView 的分割线

ListView.setDividerHeight(0);

ListView.setDivider(null);


去掉ListView 或各种滚动控件的边界颜色

android:overScrollMode="never"
android:fadingEdge="none"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: