把 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 或各种滚动控件的边界颜色
在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"
相关文章推荐
- 使用setContentView可以在Activity中动态切换显示的View
- Android 使用setContentView在一个Activity进行界面切换
- setContentView+LayoutInflater=完美切换页面(两者一定要同时使用,setContentView提高切换页面速度必看)setContentView的秘密----续上
- 安卓 setContentView使用
- setContentView(R.layout.activity_main)无法正常引用
- 使用setContentView的方式更换布局文件从而更换界面
- 研究了下Activity里的setContentView 和addContentView的区别
- android 的activity中addContentView 和 setContentView 的区别
- setContentView(R.layout.activity_main) Error解决方法
- setContentView(R.layout.activity_main) Error解决方法
- setContentView(R.layout.activity_main) Error解决方法
- ndroid setContentView 实现同一个activity下不同view的切换
- Android 使用setContentView来实现Acitivity的跳转
- 使用setContentView的方式更换布局文件从而更换界面
- setContentView(R.layout.activity_main) Error解决方法
- android开发 Activity的里面调用两次 setContentView方法
- setContentView(R.layout.activity_main) Error解决方法
- setContentView+LayoutInflater=完美切换页面(两者一定要同时使用,setContentView提高切换页面速度必看)setContentView的秘密----续上
- setContentView(R.layout.activity_main) Error解决方法
- ListActivity与setContentView的关系