Tab标签页接口---使用Intent对象

 TabHost tabHost = getTabHost();



        Intent it = new Intent();

        it.setClass(Main.this, DateTimePicker.class);

        TabSpec spec=tabHost.newTabSpec("tab1");

        spec.setContent(it);

        spec.setIndicator("ら戳㎝丁",

                getResources().getDrawable(android.R.drawable.ic_lock_idle_alarm));

        tabHost.addTab(spec);



        it = new Intent();

        it.setClass(Main.this, ProgBarDemo.class);

        spec=tabHost.newTabSpec("tab2");

        spec.setIndicator("ProgressBar",

                getResources().getDrawable(android.R.drawable.ic_dialog_alert));

        spec.setContent(it);

        tabHost.addTab(spec);



        tabHost.setCurrentTab(0);



        // 砞﹚tab夹乓砰

        TabWidget tabWidget = (TabWidget)tabHost.findViewById(android.R.id.tabs);

        View tabView = tabWidget.getChildTabViewAt(0);

        TextView tab = (TextView)tabView.findViewById(android.R.id.title);

        tab.setTextSize(20);

        tabView = tabWidget.getChildTabViewAt(1);

        tab = (TextView)tabView.findViewById(android.R.id.title);

        tab.setTextSize(20);

 

你可能感兴趣的:(intent)