ApiDemo学习 setEmptyView的用法
2013-04-16 15:37
344 查看
其实应该吧emptyView放在 listView的下面
list有数据的时候 textView不会显示 否则就会显示那个 空View
<!-- The frame layout is here since we will be showing either the empty view or the list view. --> <FrameLayout android:layout_width="match_parent" android:layout_height="0dip" android:layout_weight="1" > <!-- Here is the list. Since we are using a ListActivity, we have to call it "@android:id/list" so ListActivity will find it --> <ListView android:id="@android:id/list" android:layout_width="match_parent" android:layout_height="match_parent" android:drawSelectorOnTop="false" /> <TextView android:id="@+id/empty" android:layout_width="match_parent" android:layout_height="match_parent" android:text="@string/list_8_no_photos" /> </FrameLayout>然后list.setEmptyView(findViewById(R.id.empty));
list有数据的时候 textView不会显示 否则就会显示那个 空View
相关文章推荐
- API Demo 学习笔记——AutoCompleteTextView
- Apidemo学习 SurfaceViewOverlay
- ApiDemo - View -Animation 学习
- Android动画学习Demo(1) 关于ViewAnimation的用法及总结
- Android动画学习Demo(1) 关于ViewAnimation的用法及总结
- APIDemo学习笔记——在XML中使用自定义的View类
- Apidemo学习 android 自定义View
- View的setLayerType() , setDrawingCacheEnabled() 方法用法
- 人人网SDK Demo项目学习 3 在apilist中绑定事件调用Activity
- ListView之setEmptyView的问题
- 2014-10-31Android学习------setContentView(View view)--------GIF动画实现
- Android学习小demo(1)自定义View
- Apidemo 学习 Layers MeasureText PathEffects
- Android listview的setemptyview
- Android基础学习总结(十)——WebView的基本用法总结
- 设置 ListActivity的setEmptyView()
- 【学习笔记】tableview 简单用法,加图片,文字数组,锁定不滚动
- IOS UI学习 UITableView Demo 实现类似QQ联系人收起和展开效果
- Android ViewGroup学习总结-初步(Demo)
- Api demo源码学习(17)--App/Device Admin