[Android] 选项卡组件TabHost

【Android】利用TabHost实现选项卡效果 最近写的一个App里有两个Activity分别实现不同的功能,但是博主觉得同等重要,都应该放在主界面上。所以,博主打算把主界面做成选项卡的样子,两个Activity分别在一个选项卡上,微信、新浪微博、淘宝、大众点评等App中都用到这样的选项卡。 晒一下博主自己的xiaoguoq 阅读详情

Tab选项卡实现多个分页之间的快速切换,每个分页可以显示不同的内容,在Android平台提供了TabHost组件实现Tab选项卡的功能,选项卡组件的主要功能是可以进行应用程序分类管理。
每个选项卡称为一个Tab,而包含这多个选项卡的容器称为TabHost。

1.TabHost的常用方法

  • public TabHost (Context context): 创建TabHost类对象
  • public void addTab(TabHost.TabSpec tabSpec):增加一个tab
  • public TabHost.TabSpec newTabSpec(String tag):创建一个TabHost.TabSpec对象
  • public void clearAllTabs():清除所有关联到当前TabHost的选项卡
  • public View getCurrentView():取得当前的View对象
  • public int getCurrentTab():获取当前选项卡的ID
  • public String getCurrentTabTag():获得当前选项卡的Tag选项内容
  • public View getCurrentTabView():获取当前选项卡的视图
  • public TabHost.TabSpec newTabSpec(String tag):获取一个TabHost.TabSpec,并关联到当前TabHost
  • public void setup():建立TabHost对象
  • public void setCurrentTab(int index ):设置当前显示的Tab编号
  • public void setCurrentTabByTag(String tag):设置当前显示的Tab名称
  • public FrameLayout getTabContentView():获取并保存选项卡内容
  • public void setOnTabChangedListener(TabHost.OnTabChangeListener l):设置选项改变时触发
  • public void setup():使用findViewById()加载TabHost,在新增一个选项卡之前,需要调用它

如果要实现选项卡的显示界面,有两种实现途径:
1、直接让一个Activity程序继承TabActivity类;该方法已经废弃,不建议使用。
2、在布局文件中使用TabHost,无需继承TabActivity。
1) 在界面布局中定义TabHost组件,并为该组件定义选项卡内容
2 )使用findViewById ( )获取TabHost组件
3 )通过TabHost对象的方法来创建和添加选项卡
注意:
如果使用findViewById()方法取得TabHost组件,那么在新增一个选项卡之前,需要调用setup()方法来建立一个TabHost对象。
在TabActivity里使用getTabHost()方法获取TabHost组件,就不需要调用setup()方法。(废弃)

如果要增加一个选项卡,则需要使用方法addTab(TabHost tabhost, TabSpec tabspec),如果有多个选项就要增加多个TabHost. TabSpec对象。
TabHost. TabSpec是TabHost定义的内部类,如果要想取得此类的实例化对象,就需要依靠TabHost类的newTabSpec()来完成。
每个选项卡都包含一个选项卡指示符、内容和tag选项。

2.TabHost.TabSpec类定义的常用方法

  • public TabHost.TabSpec setContent(int viewId):设置要显示的组件ID
  • public TabHost.TabSpec setContent(Intent intent):指定一个加载activity的Intent对象作为选项卡内容
  • public TabHost.TabSpec setContent(TabHost.TabContentFactory contentFactory):指定TabHost.TabContentFactory用于创建选项卡的内容
  • public TabHost.TabSpec setIndicator(View view):指定一个视图作为选项卡指示符
  • public TabHost.TabSpec setIndicator(CharSequence label ):设置一个选项
  • public TabHost. setIndicator (ChaSequence label ,Drawable icon):为选项卡指定符指定一个选项和图标
  • public String getTag():获取tag选项字符串

对配置文件的编写有以下要求。
(1)所有用于选项配置的布局文件,必须以“”为根节点。
(2)为保证选项页和选项内容显示正常,可以采用一个布局管理器进行布局。
(3)定义一个“< TagWidget >”组件,用于表示整个选项容器。该组件的android:id=“@android:id/tabs”。
(4)定义选项页必须使用FrameLayout布局,而后在布局中定义所需要的选项页组件, 且框架布局中必须引用tabcontent组件 (android:id=“@android:id/tabcontent”)。
TabHost是整个Tab的容器,包括两部分:TabWidget和FrameLayout。其中 TabWidget:每个Tab的选项,即Tab标签;
FrameLayout:用来显示每个Tab选项切换时具体显示的内容。

3.TabWidget类常用属性

  • android: divider: 可绘制对象,被绘制在选项卡窗口间充当分割物
  • android: tabStripEnabled :确定是否在选项卡中绘制
  • android: tabStripLeft:用来绘制选项卡下面的分割线左边部分的可视化对象
  • android:tabStripRight: 用来绘制选项卡下面的分割线右边部分的可视化对象

4.TabWidget 类常用方法

  • public TabWidget (Context context ):创建TabWidget 实例
  • public void addView(View child):向TabWidget增加组件
  • public int getTabCount(): 返回选项卡的数量
  • public void setEnabled(boolean enabled):配置是否启用
  • public void focusCurrentTab(int index ):设置当前选项卡并且使其获得焦点
  • public void setCurrentTab(int index):设置当前选项卡

5.运行图

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

6.运行图

(1)activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:id="@+id/tabhost"
    tools:context=".MainActivity">
    <!--顶部导航-->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
        <!--     TabWidget   每个Tab的选项,即Tab标签-->
        <TabWidget
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@android:id/tabs"
            android:layout_alignParentTop="true"/>
        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:id="@android:id/tabcontent">
            <!--Tab页1-->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:id="@+id/file"
                android:gravity="center_horizontal"
                android:orientation="vertical">
                <Button
                    android:layout_width="200dp"
                    android:layout_height="wrap_content"
                    android:id="@+id/open"
                    android:text="打开文件"/>
                <Button
                    android:layout_width="200dp"
                    android:layout_height="wrap_content"
                    android:id="@+id/save"
                    android:text="保存文件"/>
                <Button
                    android:layout_width="200dp"
                    android:layout_height="wrap_content"
                    android:id="@+id/saveAs"
                    android:text="文件另存为"
                    />
            </LinearLayout>
            <!--Tab页2-->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:id="@+id/edit"
                android:gravity="center_horizontal"
                android:orientation="vertical"
                >
                <Button
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:id="@+id/copy"
                    android:text="复制"/>
                <Button
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:id="@+id/paste"
                    android:text="粘贴"
                    />
            </LinearLayout>
            <!--Tab页3-->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:id="@+id/seek"
                android:gravity="center_horizontal"
                android:orientation="vertical">
                <EditText
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/edit1"
                    android:text="请输入检索关键字…"
                    android:textSize="18sp"/>
                <Button
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/seekbut1"
                    android:text="搜索"/>
            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:id="@+id/time"
                android:gravity="center_horizontal"
                android:orientation="vertical">
                <TimePicker
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/seekbut"
                    android:text="设置时间"/>
            </LinearLayout>

        </FrameLayout>
    </LinearLayout>

</TabHost>

(2)MainActivity.java

package com.example.progressdialog;

import androidx.appcompat.app.AppCompatActivity;


import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TabHost;
import android.widget.Toast;


public class MainActivity extends AppCompatActivity {
    private TabHost mytabHost; //定义TabHost
    private int[]layRes={R.id.file,R.id.edit,R.id.seek,R.id.time};//定义内嵌布局管理器ID
    private Button openButton,save,saveAs,copy,paste,seekbut1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main); //调用默认布局管理器
        mytabHost=findViewById(R.id.tabhost);//取得TabHost对象
        mytabHost.setup(); //建立TabHost对象
        TabHost.TabSpec myTab1=mytabHost.newTabSpec("文件"); //定义TabSpec
        myTab1.setIndicator("文件"); //设置选项文字
        myTab1.setContent(layRes[0]);  //设置显示的组件
        mytabHost.addTab(myTab1); //增加选项

        TabHost.TabSpec myTab2=mytabHost.newTabSpec("编辑");//定义TabSpec
        myTab2.setIndicator("编辑").setContent(layRes[1]); //设置显示的组件
        mytabHost.addTab(myTab2);  //增加选项

        TabHost.TabSpec myTab3=mytabHost.newTabSpec("查看");//定义TabSpec
        myTab3.setIndicator("查看").setContent(layRes[2]); //设置显示的组件
        mytabHost.addTab(myTab3);  //增加选项

        TabHost.TabSpec myTab4=mytabHost.newTabSpec("设置");//定义TabSpec
        myTab4.setIndicator("设置").setContent(layRes[3]); //设置显示的组件
        mytabHost.addTab(myTab4);  //增加选项

        mytabHost.setCurrentTab(0);                //设置开始默认选项
//        myTabHost.setCurrentTabByTag("文件");

        openButton=findViewById(R.id.open);
        save=findViewById(R.id.save);
        saveAs=findViewById(R.id.saveAs);
        copy=findViewById(R.id.copy);
        paste=findViewById(R.id.paste);
        seekbut1=findViewById(R.id.seekbut1);

        openButton.setOnClickListener(new MyOnClickListener());
        save.setOnClickListener(new MyOnClickListener());
        saveAs.setOnClickListener(new MyOnClickListener());
        copy.setOnClickListener(new MyOnClickListener());
        paste.setOnClickListener(new MyOnClickListener());
        seekbut1.setOnClickListener(new MyOnClickListener());


    }
    private class MyOnClickListener implements View.OnClickListener {
        public void onClick(View v) {
            switch (v.getId()) {
                case R.id.open:
                    Toast.makeText(MainActivity.this,
                            "这是打开文件的按钮", Toast.LENGTH_SHORT).show();
                    break;
                case R.id.save:
                    Toast.makeText(MainActivity.this,
                            "这是保存文件的按钮", Toast.LENGTH_SHORT).show();
                    break;
                case R.id.saveAs:
                    Toast.makeText(MainActivity.this,
                            "这是文件另存为的按钮", Toast.LENGTH_SHORT).show();
                    break;
                case R.id.copy:
                    Toast.makeText(MainActivity.this,
                            "这是复制的按钮", Toast.LENGTH_SHORT).show();
                    break;
                case R.id.paste:
                    Toast.makeText(MainActivity.this,
                            "这是粘贴的按钮", Toast.LENGTH_SHORT).show();
                    break;
                case R.id.seekbut1:
                    Toast.makeText(MainActivity.this,
                            "这是搜索的按钮", Toast.LENGTH_SHORT).show();
                    break;

            }
        }
    }
}

实现底部导航运行图,再写一个布局文件,不妨命名为activity_second.xml,代码如下所示,在MainActivity.java中,将 setContentView(R.layout.activity_main);改为
setContentView(R.layout.activity_second)即可

(3)activity_second.xml

<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/tabhost"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
    <!--实现底部导航-->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1">

            <LinearLayout
                android:id="@+id/file"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:gravity="center_horizontal"
                android:orientation="vertical">

                <Button
                    android:id="@+id/open"
                    android:layout_width="150dp"
                    android:layout_height="wrap_content"
                    android:text="打开文件" />

                <Button
                    android:id="@+id/save"
                    android:layout_width="150dp"
                    android:layout_height="wrap_content"
                    android:text="保存文件" />

                <Button
                    android:id="@+id/saveAs"
                    android:layout_width="150dp"
                    android:layout_height="wrap_content"
                    android:text="文件另存为" />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/edit"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:gravity="center_horizontal"
                android:orientation="vertical">

                <Button
                    android:id="@+id/copy"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="复制" />

                <Button
                    android:id="@+id/paste"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="粘贴" />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/seek"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:gravity="center_horizontal"
                android:orientation="vertical">

                <EditText
                    android:id="@+id/edit1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="请输入检索关键字..."
                    android:textSize="18sp" />

                <Button
                    android:id="@+id/seekbut1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="搜索" />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/time"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:gravity="center_horizontal"
                android:orientation="vertical">

                <TimePicker
                    android:id="@+id/seekbut"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="设置时间" />
            </LinearLayout>
        </FrameLayout>

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_weight="0" />
    </LinearLayout>
</TabHost>


在这里插入图片描述

Android 实现选项卡效果的方法 在上述代码中,我们首先通过 findViewById() 方法获取到选项卡的容器 FrameLayout,然后在 onCreate() 方法中调用 addTab() 方法来添加选项卡。addTab() 方法接受选项卡的标签和对应的 Activity 类名作为参数,它会创建一个新的 Intent,并使用 ActivityGroup 的 getLocalActivityManager().startActivity() 方法启动对应的 Activity。如果您有任何疑问,请随时提问。 阅读详情

相关推荐

Android中TabHost组件的实现方法

TabHost是Android开发中用于创建选项卡式界面的组件,它允许用户在不同的视图间切换,而无需离开当前Activity。通过TabHost,开发者可以高效地组织多个功能模块,提升用户体验,尤其适用于内容分类较多的应用。在Android中,Intent用于启动新的Activity或者Service,以及发送广播。在TabHost的配置中,Intent用于定义和控制每个标签页启动的Activity。

weixin_28888459的博客 674

【Android从零单排系列二十八】《Android视图控件——TabHost》

小伙伴们,在上文中我们介绍了Android视图组件HorizontalScrollView,本文我们继续盘点,介绍一下视图控件的TableHost。通常用于描述Android应用程序中实现Tab布局的一种方法。Tab布局是一种常见的用户界面布局方式,允许用户在不同的选项卡之间切换内容。在Android中,可以使用多种方式来实现Tab布局,其中一种常见的方法就是使用TabHost和TabWidget组件。

商务合作|问题讨论|交流学习 请联系作者微信,加微信请务必注明来意,博客主页有联系方式 1959

自定义标题的Android多选项卡界面设计与实现

本文还有配套的精品资源,点击获取 简介:在Android开发中, TabHost 组件用于创建具备多选项卡的用户界面,实现流畅的导航体验。通过 TabWidget 和 FrameLayout 的结合,每个选项卡可以关联不同的 Activity 或 Fragment 。本文展示了如何使用 TabHo...

weixin_31860973的博客 847

Android选项卡TabHost功能和用法

1、选项卡TabHost介绍 TabHost可以方便地在窗口上放置多个标签页,每个标签页相当于获得了一个与外部容器大小相同的组件摆放区域 TabHost是一个简单的容器,提供如下两种方法来创建选项卡 newTabSpec(String tag):创建选项卡 addTab(TabHost.TabSpec tabSpec):添加选项卡 使用TabHost有三种方法 2、方法1,继承TabActivi...

钻石 4万+

Android使用(TabLayout)与(FragmentTabHost)实现底部状态栏切换

Android使用(TabLayout+ViewPager+fragment)与(FragmentTabHost+ViewPager+Fragment)实现底部状态栏切换

Android Tabhost使用方法详解

Android 实现tab视图有2种方法,一种是在布局页面中定义<tabhost>标签,另一种就是继承tabactivity.但是我比较喜欢第二种方式,应为如果页面比较复杂的话你的XML文件会写得比较庞大,用第二种方式XML页面相对要简洁得多。 下面是我的XML源码: <FrameLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical android:layout_width=fill_parent android:layout_height

Android的UI组件之TabHost(选项卡)的功能和用法

TabHost是一种可以方便的在窗口上放置多个标签,每个标签相当于一个容器,而在这个容器里可以放置不同的组件。 使用TabHost的一般步骤为: 1.在XML文件中定义TabHost组件,并为该组件定义该选项卡的内容; 2.创建一个类让这个类继承TabActivity; 3.调用TabActivity的getTabHost()方法获取TabHost对象; 4.通过获取的TabHost对象

haoba1987的专栏 1394

Python 上位机开发

首先,什么是上位机?上位机通常是指可以与下位机(如单片机、传感器等硬件设备)进行通信和交互,实现数据采集、控制指令发送以及数据处理和展示的计算机程序。 Python 作为一种高级编程语言,在开发上位机方面具有诸多优势。它拥有丰富的第三方库,使得开发过程变得相对简单和高效。

weixin_46807151的博客 4303

关于Android studio程序开发TabHost选项卡组件使用心得

关于TabHost选项卡组件使用心得 #来记录自己学习的点滴,也为了更好的复习知识 Famelayout (帧布局) Framelayout继承自ViewGroup,使用FrameLayout布局管理器时,整个界面被当成一块空白备用区域,所有的子元素都不能被指定放置的位置,它们全部放在这块区域的左上角,并且后面的子元素直接覆盖在前面的子元素之上,将前面的子元素部分或全部遮挡,即帧布局的大小由子...

qiya1234的博客 1188

给爸妈买的红米12C想装个老年桌面?先别急,解锁BL和Root前你得知道这些

本文详细解析了红米12C解锁BL和Root的利弊,为想要为长辈简化手机操作的用户提供全面指南。文章对比了BL解锁与Root的技术差异,推荐优先使用MIUI内置的极简模式等官方功能,并评估了Root的实际必要性。若必须Root,提供了安全操作流程和长期维护建议,帮助用户做出明智选择。

weixin_30265103的博客 318

python 写一个简单的 telegram bot (电报机器人)

replit.com 环境配置太恶心了,只能使用 poetry.poetry 这个名字是挺好听,用起来也是很垃圾,太恶心。heroku.com 注册登录不方便,需要各种验证。所以,部署的问题,目前搁置。

waterHBO的博客 3197

java界面选项卡切换界面_Android组件TabHost实现页面中多个选项卡切换效果

TabHost组件可以在界面中存放多个选项卡, 很多软件都使用了改组件进行设计。一、基础知识TabWidget :该组件就是TabHost标签页中上部 或者 下部的按钮, 可以点击按钮切换选项卡;TabSpec :代表了选项卡界面, 添加一个TabSpec即可添加到TabHost中;-- 创建选项卡 : newTabSpec(String tag), 创建一个选项卡;-- 添加选项卡 : addT...

weixin_34221197的博客 497

科研党福音:如何用Zotero+Paper Agent打造你的AI论文速递系统(附详细配置教程)

本文为科研工作者提供了一套利用Zotero和开源工具Paper Agent构建自动化AI论文速递系统的详细教程。该系统能基于用户在Zotero中的文献库智能学习研究兴趣,每日自动从arXiv等平台筛选、下载并深度解读最相关的前沿论文,生成个性化日报,实现从被动接收到主动精准获取的知识工作流重塑。

kite3的博客 515

android学习--TabHost选项卡组件

        TabHost是一种非常有用的组件,TabHost能够非常方便地在窗体上放置多个标签页,每一个标签页获得了一个与外部容器同样大小的组件摆放区域。在手机系统的应用类似“未接电话”、“已接电话”、“呼出电话”等。         1 、 TabHost提供了两个方法来创建选项卡、加入选项卡                newTabSpec(String tag)  : 创...

weixin_33759269的博客 109

RK3399平台开发系列讲解(外设篇)交换芯片RTL8306M

网络:交换芯片RTL8306M 电路: make menuconfig 配置: 目录:arch/arm64/configs/rk3399_b201_defconfig CONFIG_FIXED_PHY=y 设备树: arch/arm64/boot/dts/rockchip/rk3399-b201-rev1.dts 时钟: Open之后首先校验网卡mac地址是否正确(stmmac_chec...

内核笔记 2393

三菱FX系列PLC模拟量输入AD模块的使用方法和相关编程设置详解

三菱FX系列PLC模拟量输入AD模块的使用方法和相关编程设置详解

Robot_PLC_HMI_Automation 1万+

Android UI组件学习——选项卡(TabHost)的功能和用法

Android 选项卡(TabHost)的功能和用法 TabHost是一种非常实用的组件,TabHost可以很方便地在窗口上放置多个标签页,每个标签页相当于获得了一个 与外部容器相同大小的组件摆放区域。通过这种方式,就可以在一个容器里放置很多组件,例如手机系统都会在同 一个窗口中定义多个标签页来显示通话记录,包括“未接电话”、“已接电话”、“呼出电话等”。 与TabHost结合使用的还有如下组件 TabWidget:代表选项卡的标签条 TabSpec:代表选项卡的一个Tab页面 TabHost仅仅是一

霸王龙的博客 743

yocto系列讲解[实战篇]54 - 添加Qt5和生成带Qt5的SDK

为了满足读者盆友想看yocto如何添加qt5的需求,今天就开始尝试添加meta-qt5

fulinux的博客 3871

android选项卡TabHost功能和用法详解

activity_main.xml页面中定义了四个tab选项卡,里边随便放了一下组件。//res.getDrawable(R.drawable.wo)添加图片。.setIndicator(“tab1”) //设置标题。MainActivity.java(大部分都有注释)//获取该Activity里面的TabHost组件。//设置默认选项卡,第几个,从0开始。//初始化TabHost容器。//创建第一个Tab页。//添加第一个标签页。

2501_90193411的博客 551

【SOUND】Linux音频子系统ASoC的驱动框架总分析

ALSA系统在芯片(ASoC)层的总体项目目标是为嵌入式芯片处理器(例如PXA2XX,AU1X00,IMX等)和便携式音频编解码器提供更好的ALSA支持。 在进入ASoC子系统之前,内核对SoC音频有一些支持,但是它有一些局限性:ASoC层旨在解决这些问题并提供以下内容特征 :为了实现这一切,ASoC基本上将嵌入式音频系统分为多个可重复使用的组件驱动程序:另外,这里提下OSS(Open Sound System)这个基本被弃用的音频框架。 可以参考Linux OSS架构声卡驱动框架 2.3 ASoC重要

wang 恒 的博客 1783

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

2010.11.11———Android TabHost选项卡组件

2010.11.11———Android TabHost选项卡组件 参考:[url]http://www.cnblogs.com/keyindex/articles/1815074.html[/url] 其实 TabHost 有两种写法 [code="java"]1、继承Activity 用finViewById() 来得到TabHost 2、继承TabActivity 用get...

94

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

Anroid-通用组件- 滚动视图组件(ScrollView)-选项卡组件(TabHost-TabWidge-FrameLayout)

Android提供了ScrollView滚动视图组件,用于为组件提供滚动效果,还提供了选项卡组件它由(TabHost-TabWidge-FrameLayout)三个组件组成, 滚动视图组件(ScrollView) 1.当内容比较多,不能一屏显示的时候,就用到了滚动条组件,用户可以通过滚动屏幕查看完整内容。 2.滚动视图组件继承自帧布局管理器, 3.因此在滚动条组件中可以添加任意组件,但是一个滚动视图里只能放一个组件。 4.如果有放入多个组件组件的需求,可以在滚动视图里添加一个布局管理器,然后将组件放在布局管

csdnbian的博客 419

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

android应用组件构图,详解Android应用中使用TabHost组件进行布局的基本方法

TabHost布局文件我们先来了解一下布局文件的基本内容:1. 根标签及id设置Android自带id : XML布局文件中, 可以使用 标签设置, 其中的id 需要引用 android的自带id :android:id=@android:id/tabhost ;getHost()获取前提 : 设置了该id之后, 在Activity界面可以使用 getHost(), 获取这个TabHost 视图对...

weixin_42549117的博客 224

Android - TabHost 选项卡功能用法详解

Android - TabHost 选项卡功能用法详解 一. TabHost介绍 TabHost组件可以在界面中存放多个选项卡, 很多软件都使用了改组件进行设计;默认都是在屏幕上端的,如何做一个现实在屏幕下端的呢? 1. TabHost常用组件 TabWidget : 该组件就是TabHost标签页中上部或者下部的按钮, 可以点击按钮切换选项卡; TabSpec : 代表

优快云YUANDAIMAXUEXI的博客 1870

Android —— Tabhost选项卡的使用

Tabhost就是平时常见的选项卡控件,如下所示: 这样的选项卡控件,已经集成了点击切换的功能,编写界面的人员只需要编写每个选项卡和选项卡代表的内容即可 (1)常用组件如下所示: ①TabWidget:该组件就是Tabhost标签页中的按钮,点击这些按钮可以切换选项卡,以切换显示的内容 ②FrameLayout:该组件就是放置每个选项卡所显示的内容的控件,如图所示,

JuneCock的博客 3786
上一篇: [Android] 图片切换组件ImageSwitcher
下一篇: [Android] Intent启动activity方式
冰落風絡
博客等级 码龄5年 28粉丝 16原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值