- 浏览: 239624 次
- 性别:
- 来自: 深圳
文章分类
最新评论
-
江恂泽:
楼主 这家伙会把data 拆分开来 转换成day year形 ...
JsonUtil -
mdsp25xhm:
为何没有列表查询功能?
myBatis DAO封装
private TabHost tabHost;
private int[] layRes = { R.id.t_1, R.id.t_2 , R.id.t_3 };
@Override
protected void onCreate(Bundle instance)
{
super.onCreate(instance);
initResource();
}
/**
* 初始化资源
*
* @param
* @return void
* @throws
* @since TianTian
*/
private void initResource()
{
tabHost = super.getTabHost();
LayoutInflater.from(this).inflate(R.layout.thost, tabHost.getTabContentView(), true);
/*
* 循环取出所有布局标记
*/
for (int x = 0; x < this.layRes.length; x++)
{
TabSpec myTab = tabHost.newTabSpec("tab" + x); // 定义TabSpec
myTab.setIndicator("标签 - " + x); // 设置标签文字
myTab.setContent(this.layRes[x]); // 设置显示的组件
this.tabHost.addTab(myTab); // 增加标签
}
}
xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background="@color/coral">
<LinearLayout android:id="@+id/linearLayout1"
android:layout_width="match_parent" android:layout_height="match_parent">
<LinearLayout android:layout_height="match_parent"
android:id="@+id/t_1" android:layout_width="wrap_content">
<ImageView android:layout_height="wrap_content"
android:src="@drawable/jt5" android:id="@+id/imageView1"
android:layout_width="wrap_content"></ImageView>
</LinearLayout>
<LinearLayout android:layout_height="match_parent"
android:id="@+id/t_2" android:layout_width="wrap_content">
<ImageView android:layout_height="wrap_content"
android:src="@drawable/jt6" android:id="@+id/imageView1"
android:layout_width="wrap_content"></ImageView>
</LinearLayout>
<LinearLayout android:layout_height="match_parent"
android:id="@+id/t_3" android:layout_width="wrap_content">
<ImageView android:layout_height="wrap_content"
android:src="@drawable/jt7" android:id="@+id/imageView1"
android:layout_width="wrap_content"></ImageView>
</LinearLayout>
</LinearLayout>
</LinearLayout>
private int[] layRes = { R.id.t_1, R.id.t_2 , R.id.t_3 };
@Override
protected void onCreate(Bundle instance)
{
super.onCreate(instance);
initResource();
}
/**
* 初始化资源
*
* @param
* @return void
* @throws
* @since TianTian
*/
private void initResource()
{
tabHost = super.getTabHost();
LayoutInflater.from(this).inflate(R.layout.thost, tabHost.getTabContentView(), true);
/*
* 循环取出所有布局标记
*/
for (int x = 0; x < this.layRes.length; x++)
{
TabSpec myTab = tabHost.newTabSpec("tab" + x); // 定义TabSpec
myTab.setIndicator("标签 - " + x); // 设置标签文字
myTab.setContent(this.layRes[x]); // 设置显示的组件
this.tabHost.addTab(myTab); // 增加标签
}
}
xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background="@color/coral">
<LinearLayout android:id="@+id/linearLayout1"
android:layout_width="match_parent" android:layout_height="match_parent">
<LinearLayout android:layout_height="match_parent"
android:id="@+id/t_1" android:layout_width="wrap_content">
<ImageView android:layout_height="wrap_content"
android:src="@drawable/jt5" android:id="@+id/imageView1"
android:layout_width="wrap_content"></ImageView>
</LinearLayout>
<LinearLayout android:layout_height="match_parent"
android:id="@+id/t_2" android:layout_width="wrap_content">
<ImageView android:layout_height="wrap_content"
android:src="@drawable/jt6" android:id="@+id/imageView1"
android:layout_width="wrap_content"></ImageView>
</LinearLayout>
<LinearLayout android:layout_height="match_parent"
android:id="@+id/t_3" android:layout_width="wrap_content">
<ImageView android:layout_height="wrap_content"
android:src="@drawable/jt7" android:id="@+id/imageView1"
android:layout_width="wrap_content"></ImageView>
</LinearLayout>
</LinearLayout>
</LinearLayout>
发表评论
-
IMF简介-2
2013-07-09 17:56 863InputManager 由UI控件(View,TextVie ... -
IMF简介-1
2013-07-09 17:51 785Input Method Framework 目录 ... -
输入法 总结-3
2013-07-08 15:02 824public class MainActivity exten ... -
输入法 总结-4
2013-07-04 17:29 908public class InputActivity exte ... -
输入法 总结-3
2013-07-04 17:28 838public class InputApplication e ... -
输入法 总结-2
2013-07-04 17:23 746openwnn_pref_ja.xml <?xml v ... -
输入法 总结-2
2013-07-04 17:21 13openwnn_pref_ja.xml <?xml v ... -
输入法 总结-1
2013-07-04 17:19 773<application android ... -
Android快捷键
2013-03-15 14:39 780Home键(小房子键) 在 ... -
如何通过wifi调试android程序
2013-02-27 15:48 723android手机居然可以通过wifi进行程序的调试,太好了, ... -
Please ensure that adb is correctly located at 'D:\android-sdk-windows\platform-
2013-02-27 14:27 1621adt 出现ADB server didn't ACK, fa ... -
Android AsyncTask
2013-02-19 09:35 1069AsyncTask是抽象类,子类 ... -
Android ViewPager 左右滑动2-1
2013-01-29 10:12 1421public class PagerActivity exte ... -
Android ViewPager 左右滑动-3
2013-01-29 10:10 1074<?xml version="1.0" ... -
Android ViewPager 左右滑动-2
2013-01-29 10:10 1413/*** * 选中效果 */ pu ... -
Android ViewPager 左右滑动-1
2013-01-29 10:09 1343Store extends ActivityGroup imp ... -
Android 下载
2013-01-27 00:59 877下载apk程序代码 protected File downLo ... -
Android SDCard操作-3
2013-01-26 18:31 851public static Intent getVid ... -
Android SDCard操作-2
2013-01-26 18:30 1053/** * 判断该应用在手机中的安装情况 ... -
Android SDCard操作-1
2013-01-26 18:27 1007private static int INSTALLED = ...
相关推荐
android Tabhost使用Demo
android TabHost使用详解 TabHost从布局到代码的使用步骤
androidTabhost的使用实例代码,仅供参考
NULL 博文链接:https://technicalsearch.iteye.com/blog/1924614
超详尽的Tabhost使用详解,我是总结了好久
Android TabHost ListView初学者的实例代码
android TabHost(标签)的使用 简单实例。
android tabhost 动态添加 删除 排序 重命名
Android 嵌套TabHost示例. 两层TabHost嵌套,实现的效果类似网页上的二级菜单栏。
Android Tabhost 实例demo 自定义Tabhost实现实例。
android tabhost 动态添加,删除,排序,重命名
Android TabHost动态增加和删除
Android TabHost 经典使用技巧
Android 实现tab视图有2种方法,一种是在布局页面中定义<tabhost>标签,另一种就是继承tabactivity.但是我比较喜欢第二种方式,应为如果页面比较复杂的话你的XML文件会写得比较庞大,用第二种方式XML页面相对要简洁得...
android TabHost分页 demo 一开始就能用
android tabhost 动态添加,删除,排序,重命名
Android TabHost ListView 使用实例
Android TabHost TabWidget 切换卡
android Tabhost 实现底部菜单效果 菜单的图片和文字可以同时显示且选中带效果