使用visibility属性在Tabhost里实现更改Tabs的内容
2015-11-25 21:39
302 查看
使用含有listview的tabhost的时候我想实现:点击listview中的子项时直接在原来的tabs里面显示网页,那么就是怎样实现tabs的更改问题,突然想到有一个visibility
android:visibility="gone" 其有三个属性:visible显示;invisible显示黑背景条;gone不显示,在类中,setVisibility(View.GONE);不显示 setVisibility(View.VISIBLE);显示。
于是就想着用他来实现,
android:visibility="gone" 其有三个属性:visible显示;invisible显示黑背景条;gone不显示,在类中,setVisibility(View.GONE);不显示 setVisibility(View.VISIBLE);显示。
于是就想着用他来实现,
<LinearLayout android:id="@+id/ll_tab4" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ImageView android:id="@+id/img4_http" android:layout_width="match_parent" android:layout_height="wrap_content" android:src="@drawable/sgouchang01" android:visibility="visible" > </ImageView> <ListView android:id="@+id/lv_httphelp" android:layout_width="match_parent" android:layout_height="match_parent" android:visibility="visible" > </ListView> <WebView android:id="@+id/wv4_http" android:layout_width="match_parent" android:layout_height="match_parent" android:visibility="gone" /> </LinearLayout> </FrameLayout> </LinearLayout> </TabHost>
m4ListView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { // ((TextView) arg1.findViewById(R.id.tv4_httphelp)) // .setText(m4uri[arg2]); jv_Home.this.findViewById(R.id.wv4_http).setVisibility( View.VISIBLE); jv_Home.this.findViewById(R.id.img4_http).setVisibility( View.GONE); jv_Home.this.findViewById(R.id.lv_httphelp).setVisibility( View.GONE); Log.e(TAG, "不可见被执行!"); } });
相关文章推荐
- [Ubuntu] Acer V5-471G关机后重新启动问题,无法关机
- 湖南工业大学创新实验室2015年新生赛(一)1009(重开)
- 在mac系统安装Apache Tomcat的详细步骤(转载自himi的博客,修改了错误添加了图片)
- Linux-epoll
- PAT 1092. To Buy or Not to Buy (20)
- ubuntu下激活matlab
- 欧拉角pitch、yaw,roll的理解
- 【C语言】 函数指针小谈
- java dfs
- 最短路径——Floyd算法
- 备忘录模式实现画图板撤销操作
- Squares
- 使用JSONModel小记
- ---frame---收尾式动画---枚举
- 信息安全系统设计基础_exp3
- 一个java文件编译之后会产生多个class文件
- zzuoj 10409: D.引水工程
- 602B - Approximating a Constant Range (STL 贪心)
- Linux后台开发的要求
- 分支限界法