java代码中写得TableLayout,并且实现了空项的自动隐藏
来源:互联网 发布:js钩子函数 编辑:程序博客网 时间:2024/06/05 02:09
// 更新热门商区的列表
TableLayout tableLayout = (TableLayout)searchActivityView.findViewById(R.id.id_for_search_activity_table_layout);
if(result.size()>=3) {
tableLayout.getChildAt(2).setVisibility(View.VISIBLE);
tableLayout.getChildAt(1).setVisibility(View.VISIBLE);
tableLayout.getChildAt(0).setVisibility(View.VISIBLE);
searchActivityView.setMoreAreasFirstLineWord(result.get(0));
searchActivityView.setMoreAreasSecondLineWord(result.get(1));
searchActivityView.setMoreAreasThirdLineWord(result.get(2));
} else if(result.size()==2) {
searchActivityView.setMoreAreasFirstLineWord(result.get(0));
searchActivityView.setMoreAreasSecondLineWord(result.get(1));
searchActivityView.setMoreAreasThirdLineWord("");
tableLayout.getChildAt(2).setVisibility(View.GONE);
tableLayout.getChildAt(1).setVisibility(View.VISIBLE);
tableLayout.getChildAt(0).setVisibility(View.VISIBLE);
} else if(result.size()==1) {
searchActivityView.setMoreAreasFirstLineWord(result.get(0));
searchActivityView.setMoreAreasSecondLineWord("");
searchActivityView.setMoreAreasThirdLineWord("");
tableLayout.getChildAt(2).setVisibility(View.GONE);
tableLayout.getChildAt(1).setVisibility(View.GONE);
tableLayout.getChildAt(0).setVisibility(View.VISIBLE);
} else if(result.size()==0) {
searchActivityView.setMoreAreasFirstLineWord("");
searchActivityView.setMoreAreasSecondLineWord("");
searchActivityView.setMoreAreasThirdLineWord("");
tableLayout.getChildAt(2).setVisibility(View.GONE);
tableLayout.getChildAt(1).setVisibility(View.GONE);
tableLayout.getChildAt(0).setVisibility(View.GONE);
}
setContentView(searchActivityView);
- java代码中写得TableLayout,并且实现了空项的自动隐藏
- 用CSS实现文字的自动隐藏 并且出现三点
- 用shell写了一个自动编译代码的脚本
- 用shell写了一个自动编译代码的脚本
- 随手写了一段C++访问LDAP, 并且获取sid的代码
- android 的tablelayout 中textview不会自动换行的解决办法
- 在java后台用javacript写一段小代码实现html页面颜色的自动改变
- Java中继承thread类与实现Runnable接口的区别(转载,写得不对,不过有参考意义)
- ASP自动隐藏数据库中内容为空的字段(以图片为例)
- 写代码提高效率的几点心得
- 实现窗体自动隐藏(c代码)
- Ibatis 中做了分页,并且想做修改日期的排序,配置文件怎么写
- java 60 行代码写一个简单可用的并且带过期时间的内存缓存
- Java---实现运行任意目录下class中加了@MyTest的空参方法(实现图形界面)
- TableLayout 清空所有的行数据
- Js实现订阅发布模式(让你的代码写得贼六)
- Java中写代码的快捷方式
- jsp中写java代码的方式
- 三种方法实现Delphi无标题窗体的拖动
- 如何禁止STL map 自动排序
- Random()方法的使用
- 根据模版导出简单Word文档
- js图片上传预览(这是还没有上传到服务器的时候进行的图片预览代码)
- java代码中写得TableLayout,并且实现了空项的自动隐藏
- c++中__declspec用法总结
- 从尾到头输出链表--总结
- wf HandleExternalEventActivity
- 零值指针指向何处?
- 中国各银行的PK!
- 我的一天
- flex视频地址
- 关于declspec(naked)说明