[转]Android UI学习 - Tab的学习和使用

转自:http://www.cnblogs.com/lm3515/archive/2011/3/16.html

 

public void setDefaultTab (String tag) 这两个函数很易懂,就是设置默认的Tab
   public void setDefaultTab (int index)  通过tab名——tag或者index(从0开始)
  
   protected void onRestoreInstanceState (Bundle state) 这两个函数的介绍可以
   protected void onSaveInstanceState (Bundle outState) 参考 Activity的生命周期
 
TabHost
  那么我们要用到的Tab载体是TabHost,需要从TabActivity.getTabHost获取。
  现在看看TabHost类,它有3个内嵌类:1个类TabHost.TabSpec,2个接口TabHost.TabContentFactory和TabHost.OnTabChangeListener。后面会介绍这些类和接口。
 
  TabHost类的一些函数:
   public void addTab (TabHost.TabSpec tabSpec) 添加tab,参数TabHost.TabSpec通过下面的函数返回得到
   public TabHost.TabSpec newTabSpec (String tag) 创建TabHost.TabSpec
  
   public void clearAllTabs () remove所有的Tabs
   public int getCurrentTab ()
   public String getCurrentTabTag ()
   public View getCurrentTabView ()
   public View getCurrentView ()
   public FrameLayout getTabContentView () 返回Tab content的FrameLayout
 
   public TabWidget getTabWidget ()
   public void setCurrentTab (int index)       设置当前的Tab by index
   public void setCurrentTabByTag (String tag) 设置当前的Tab by tag
   public void setOnTabChangedListener (TabHost.OnTabChangeListener l) 设置TabChanged事件的响应处理
   public void setup () 这个函数后面介绍
 
TabHost.TabSpec
  从上面的函数可以知道如何添加tab了,要注意,这里的Tag(标签),不是Tab按钮上的文字。
  而要设置tab的label和content,需要设置TabHost.TabSpec类。 引用SDK里面的话——“A tab has a tab indicator, content, and a tag that is used to keep track of it.”,TabHost.TabSpec就是管理这3个东西:
   public String getTag ()
   public TabHost.TabSpec setContent
   public TabHost.TabSpec setIndicator
 
  我理解这里的 Indicator就是Tab上的label,它可以
   设置label:  setIndicator (CharSequence label)
  或者同时 设置label和icon: setIndicator (CharSequence label, Drawable icon)
  或者直接 指定某个view:  setIndicator (View view)
  
  对于 Content,就是Tab里面的内容,可以
   设置View的id:  setContent(int viewId)
  或者 TabHost.TabContentFactory的createTabContent(String tag)来处理: setContent(TabHost.TabContentFactory contentFactory)
  或者用 new Intent来引入其他Activity的内容: setContent(Intent intent)
  
  现在来看官方的Views/Tabs/Content By Id例子:

TabHost

   代码
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
public class Tabs1 extends TabActivity {
  
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super .onCreate(savedInstanceState);
         TabHost tabHost = getTabHost();
          
         LayoutInflater.from( this ).inflate(R.layout.tabs1, tabHost.getTabContentView(), true );
  
         tabHost.addTab(tabHost.newTabSpec( "tab1" )
                 .setIndicator( "tab1" )
                 .setContent(R.id.view1));
         tabHost.addTab(tabHost.newTabSpec( "tab3" )
                 .setIndicator( "tab2" )
                 .setContent(R.id.view2));
         tabHost.addTab(tabHost.newTabSpec( "tab3" )
                 .setIndicator( "tab3" )
                 .setContent(R.id.view3));
     }
}
   原来在获取TabHost后,需要用LayoutInflater来得到Layout,LayoutInflater在后面就详细介绍。R.layout.tabs1的内容:
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<FrameLayout xmlns:android= "http://schemas.android.com/apk/res/android"
     android:layout_width= "fill_parent"
     android:layout_height= "fill_parent" >
  
     <TextView android:id= "@+id/view1"
         android:background= "@drawable/blue"
         android:layout_width= "fill_parent"
         android:layout_height= "fill_parent"
         android:text= "@string/tabs_1_tab_1" />
  
     <TextView android:id= "@+id/view2"
         android:background= "@drawable/red"
         android:layout_width= "fill_parent"
         android:layout_height= "fill_parent"
         android:text= "@string/tabs_1_tab_2" />
  
     <TextView android:id= "@+id/view3"
         android:background= "@drawable/green"
         android:layout_width= "fill_parent"
         android:layout_height= "fill_parent"
         android:text= "@string/tabs_1_tab_3" />
  
</FrameLayout>
  
<! -- strings.xml
     <string name= "tabs_1_tab_1" >tab1</string>
     <string name= "tabs_1_tab_2" >tab2</string>
     <string name= "tabs_1_tab_3" >tab3</string>
-->
  原来是用FrameLayout的!
  而让Tab1的内容显示tab1且背景为Blue,是setContent(R.id.view1)这里引用了TextView1。现在就基本明白如何添加tab以及如何设置label和content了。
 
  接下来看看Views/Tabs/Content By Factory的例子:

TabHost2

  代码
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
public class Tabs2 extends TabActivity implements TabHost.TabContentFactory {
      
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super .onCreate(savedInstanceState);
  
         final TabHost tabHost = getTabHost();
         tabHost.addTab(tabHost.newTabSpec( "tab1" )
                 .setIndicator( "tab1" , getResources().getDrawable(R.drawable.star_big_on))
                 .setContent( this ));
         tabHost.addTab(tabHost.newTabSpec( "tab2" )
                 .setIndicator( "tab2" )
                 .setContent( this ));
         tabHost.addTab(tabHost.newTabSpec( "tab3" )
                 .setIndicator( "tab3" )
                 .setContent( this ));
     }
  
     public View createTabContent(String tag) {
         final TextView tv = new TextView( this );
         tv.setText( "Content for tab with tag " + tag);
         return tv;
     }
}
    可以看到通过override重写(重新实现)父类TabHost.TabContentFactory中的方法View createTabContent(String tag)来实现不同tab的不同content。同时在setContent的参数设置为相应的TabContentFactory。
   原来createTabContent是在每个tab第一次显示时才调用的,随后再次显示该tab就不会再次调用的,我自己用Logcat查看到的!这一点很关键,就是说在createTabContent是在tab没有完全创建前调用的,这意味在createTabContent里面是不能调用getCurrentTabView等之类的函数的,否则就出错!
 
   至于Views/Tabs/Content By Intent例子,就只是贴出代码,不给截图了:
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
public class Tabs3 extends TabActivity {
      
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super .onCreate(savedInstanceState);
  
         final TabHost tabHost = getTabHost();
  
         tabHost.addTab(tabHost.newTabSpec( "tab1" )
                 .setIndicator( "list" )
                 .setContent( new Intent( this , List1. class )));
  
         tabHost.addTab(tabHost.newTabSpec( "tab2" )
                 .setIndicator( "photo list" )
                 .setContent( new Intent( this , List8. class )));
          
         // This tab sets the intent flag so that it is recreated each time
         // the tab is clicked.
         tabHost.addTab(tabHost.newTabSpec( "tab3" )
                 .setIndicator( "destroy" )
                 .setContent( new Intent( this , Controls2. class )
                         .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)));
     }
}
效果:Tab1的内容是List1的Activity,Tab2的是List8的Activity,Tab3的是controls2.Activity。
 
TabHost.OnTabChangeListener
   TabHost.OnTabChangeListener接口只有一个抽象方法onTabChanged(String tagString),明显地,在 onTabChanged(String tagString)方法里面swtich..case..来判断tagString分别处理就行了。
 
TabHost.setup()
  在此贴出SDK doc里面的相关解释:
public   void  setup () Since: API Level  1
Call setup() before adding tabs 
if  loading TabHost using findViewById(). However,You  do  not need to call setup() after getTabHost() in TabActivity. Example:

mTabHost 
=  (TabHost)findViewById(R.id.tabhost);
mTabHost.setup();
mTabHost.addTab(TAB_TAG_1, 
" Hello, world! " ,  " Tab 1 " );

// 我的理解是,如果要用到findViewById来获取TabHost,然后add tabs的话,需要在addTab前call setup();
public   void  setup (LocalActivityManager activityGroup) Since: API Level  1
If you are using setContent(android.content.Intent), 
this  must be called since the activityGroup is needed to launch the local activity. This is done  for  you  if  you extend TabActivity.

Parameters
activityGroup Used to launch activities 
for  tab content.

posted @ 2011-03-16 10:55 子非あ鱼 阅读(671) 评论(0)  编辑

何谓标签 印象最深刻的应该是这个

 

 

 

 

现在 我们将通过一系列的扩展来研究之

写道
1. 自定义TabActivity 使得标签处于屏幕下方  
2. 各个标签所用布局 既可在 *.xml 中定义 也可在 *.java 中定义  
3. 更改标签布局

 

 

1. 标签页 在 屏幕下方

写道
一个典型的标签Activity  是由2 部分构成的 且其id都有规定 即:  
* TabWidget 用于展示标签页 id=tabs  
* FrameLayout 用于展示隶属于各个标签的具体布局 id=tabcontent

 

* 基本布局如下:

xml代码

?
<?xml version= "1.0" encoding= "utf-8" ?>
<TabHost xmlns:android= "http://schemas.android.com/apk/res/android"
     android:id= "@android:id/tabhost"
     android:layout_width= "fill_parent"  
     android:layout_height= "fill_parent" >
<LinearLayout  
     android:orientation= "vertical"
     android:gravity= "bottom"
     android:layout_width= "fill_parent"  
     android:layout_height= "fill_parent" >
<FrameLayout  
     android:id= "@android:id/tabcontent"
     android:layout_width= "fill_parent"  
     android:layout_height= "200dip" >
     
     <RelativeLayout
     android:id= "@+id/view1"
     android:orientation= "vertical"
     android:layout_width= "fill_parent"
     android:layout_height= "fill_parent"
     >
         <TextView 
             android:id= "@+id/text"
             android:layout_width= "wrap_content"
             android:layout_height= "wrap_content"
             android:text= "Hello to Johnny.Griffin!"
             android:layout_centerInParent= "true"
             android:textStyle= "bold|italic" />
         <ImageView 
             android:layout_width= "fill_parent"
             android:layout_height= "fill_parent"
             android:src= "@drawable/robot"
             android:layout_toLeftOf= "@id/text" />
     </RelativeLayout>
     
     <TextView
         android:id= "@+id/view2"
         android:layout_width= "fill_parent"
         android:layout_height= "fill_parent"
         android:text= "创新源于模仿!" />
         
     <TextView
         android:id= "@+id/view3"
         android:layout_width= "fill_parent"
         android:layout_height= "fill_parent"
         android:text= "欢迎进入 droid 世界!" />
         
     <ImageView
         android:id= "@+id/view4"
         android:layout_width= "fill_parent"
         android:layout_height= "fill_parent"
         android:src= "@drawable/robot" />
</FrameLayout>
<TabWidget  
     android:id= "@android:id/tabs"
     android:layout_width= "fill_parent"  
     android:layout_height= "wrap_content" />  
</LinearLayout>  
</TabHost>

* 得到TabHost tHost 仅在TabActivity中有效

Java代码   
  1. tHost = this.getTabHost();  

 

 

* 创建4个标签 并指定所使用的布局

Java代码

?
public static final String Tab1 = "Tab1" ;
public static final String Tab2 = "Tab2" ;
public static final String Tab3 = "Tab3" ;
public static final String Tab4 = "Tab4" ;
public static final String Tab5 = "Tab5" ;
 
tHost.addTab(tHost.newTabSpec(Tab1).setIndicator( "Tab 1" , getResources().getDrawable(R.drawable.icon)).setContent(R.id.view1));
         tHost.addTab(tHost.newTabSpec(Tab2).setIndicator( "Tab 2" , getResources().getDrawable(R.drawable.beijing_small)).setContent(R.id.view2));
         tHost.addTab(tHost.newTabSpec(Tab3).setIndicator( "Tab 3" ).setContent(R.id.view3));
         tHost.addTab(tHost.newTabSpec(Tab4).setIndicator( "Tab 4" ).setContent(R.id.view4));

 

 

* 设定监听器 用于监听 标签间切换事件

?
1
2
3
4
5
6
7
tHost.setOnTabChangedListener( new OnTabChangeListener(){
             @Override
             public void onTabChanged(String tabId) {
                 // TODO Auto-generated method stub
             }
             
         });

 

 

* emulator 运行情况:

 

 

 

 

2.  在 *.java 中定义标签所需布局

 Java代码

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
public class CustomLayout implements TabHost.TabContentFactory  {
         Activity activity;
         LayoutInflater inflaterHelper;
         
         LinearLayout layout;
         
         public CustomLayout (Activity a) {
             activity = a;
             
             inflaterHelper = a.getLayoutInflater();
         }
         
         /** {@inheritDoc} */ //tag 标记各个标签
         public View createTabContent(String tag) {
                 return addCustomView(tag);
         }
         
         public View addCustomView(String id){
             
             layout = new LinearLayout(activity);
             layout.setOrientation(LinearLayout.VERTICAL);
             
             
             if (id.equals(Tab1)){
                 ImageView iv = new ImageView(activity);
                 iv.setImageResource(R.drawable.beijing_big);
                 layout.addView(iv,
                         new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT));
             }
             else if (id.equals(Tab2)){
                 EditText edit = new EditText(activity);
                 layout.addView(edit,
                         new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT));
                 
                 Button btn = new Button(activity);
                 btn.setText( "OK" );
                 btn.setWidth( 100 );
                 layout.addView(btn,
                         new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT));
                 
                 RadioGroup rGroup = new RadioGroup(activity);
                 rGroup.setOrientation(LinearLayout.HORIZONTAL);
                 RadioButton radio1 = new RadioButton(activity);
                 radio1.setText( "Radio A" );
                 rGroup.addView(radio1);
                 RadioButton radio2 = new RadioButton(activity);
                 radio2.setText( "Radio B" );
                 rGroup.addView(radio2);
                 
                 layout.addView(rGroup,
                         new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT));
             }
             else if (id.equals(Tab3)){
                 
                 LinearLayout.LayoutParams param3 =
                     new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT);
                 
                 layout.addView(inflaterHelper.inflate(R.layout.hello, null ),param3);
             }
             else if (id.equals(Tab4)){
                 TextView tv = new TextView(activity);
                 tv.setText( "HelloTags!" );
                 tv.setGravity(Gravity.CENTER);
                 layout.addView(tv);
             }
 
             return layout;
         }
         
     }

 

 

 

* 如何使用:

Java代码   
  1. CustomLayout ct = new CustomLayout(this);  
  2.   
  3. tHost.addTab(tHost.newTabSpec(Tab4).setIndicator("Tab 4").setContent(ct));  

 

 * emulator 运行结果:

 

 

 

 

3. 改变标签布局

 

写道
可能很多人对TabActivity 不满意 原因之一:其很不美观 而不美观的根源就是:标签的问题 其图像和文字相互覆盖 导致的  


那么 我们可以自己扩展么? 当然

 

 

写道
TabWidget 理解:  

1. TabWidget 为 horizontal 的 LinearLayout  
2. 且 其包含的标签又是一个RelativeLayout  
3. 每个标签RelativeLayout 里面包含2个View: TextView ImageView

 

 

因此 我们甚至可以推算出其布局为:

xml代码

?
<?xml version= "1.0" encoding= "utf-8" ?>
<LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android"
     android:orientation= "horizontal"
     android:layout_width= "fill_parent"
     android:layout_height= "fill_parent"
     >
<RelativeLayout
     android:orientation= "vertical"
     android:layout_width= "fill_parent"
     android:layout_height= "wrap_content" >
     <ImageView  />
     <TextView  />
</RelativeLayout>
<RelativeLayout
     android:orientation= "vertical"
     android:layout_width= "fill_parent"
     android:layout_height= "wrap_content" >
     <ImageView  />
     <TextView  />
</RelativeLayout>
<RelativeLayout
     android:orientation= "vertical"
     android:layout_width= "fill_parent"
     android:layout_height= "wrap_content" >
     <ImageView  />
     <TextView  />
</RelativeLayout>
<RelativeLayout
     android:orientation= "vertical"
     android:layout_width= "fill_parent"
     android:layout_height= "wrap_content" >
     <ImageView  />
     <TextView  />
</RelativeLayout>
</LinearLayout>

 

 

* 去掉系统默认的布局 即 在 setIndicator() 中置空 修改如下:

Java代码   
  1. tHost.addTab(tHost.newTabSpec(Tab1).setIndicator("").setContent(ct));   

 

写道
可能有人会说:那我不调用setIndicator() 不久可以了么 不行 否则 会报错

 

 

* 自己定义布局 并 指定显示的内容

Java代码

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
public View composeLayout(String s, int i){
         LinearLayout layout = new LinearLayout( this );
         layout.setOrientation(LinearLayout.VERTICAL);
         
         TextView tv = new TextView( this );
         tv.setGravity(Gravity.CENTER);
         tv.setSingleLine( true );
         tv.setText(s);
         layout.addView(tv,
                 new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
         
         ImageView iv = new ImageView( this );
         iv.setImageResource(i);
         layout.addView(iv,
                 new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
         return layout;
     }

 

 

* 得到 TabWidget 实例 tw

Java代码   
  1. LinearLayout ll=(LinearLayout)tHost.getChildAt(0);   
  2.         tw =(TabWidget)ll.getChildAt(1);  

 

 

* 得到 TabWidget 内的具体某个Layout 并使用上面的布局 composeLayout()

Java代码   
  1. public void updateWidgetView(int i,String text,int image){  
  2.         RelativeLayout rl =(RelativeLayout)tw.getChildAt(i);  
  3.           
  4.         rl.addView(composeLayout(text,image));  
  5.     }  

 

 

* emulator 运行截图 // 前面 3个是使用新布局 最后一个是使用TabActivity 默认的布局 哪个好看 大家自己选择之

 

Android Tab切换:ViewPager与Fragment技术实现及优化 本文还有配套的精品资源,点击获取 简介:在Android开发中,实现Tab切换与页面滑动是UI设计和用户体验的重要组成部分。本文深入探讨了几种主流的实现策略,包括ViewPager与PagerAdapter的组合、ViewPager与Fragment及FragmentPagerAdapter的结合,以及传统的TabHost与TabWidget。详细介绍了ViewPager的... 阅读详情

相关推荐

FPGA八股文(2)——笔试的FPGA问题汇总(持续更新)

常见FPGA笔试题的概念总结

居安士的博客 8902

Android学习笔记-TabHost选项卡使用

在Android应用中,经常会用到TabHost选项卡,这里借花献佛,把apiDemo例子中的使用方法列举出来,,, 常用的方法有三种: 1. 从一个layout id创建各个tab页 [java] view plaincopy public class Tabs1 extends TabActivity {       @Override

小范屯 866

【乐企文件生成工程】关于乐企文件生成工程的详细介绍

发票文件生成方式有两种思路:1、根据已有的OFD模板,动态替换ofd模板内容;之后将ofd转pdf(局限:单行问题不大)详情可以在此处了解2、根据html模板动态占位:该工程就是这种方式 ,目前效果良好,可看下图。拿去即用的源码!无任何保留,当然也并不是所有票种都支持(时间有限、精力有限、已经连着转了,要冒烟了…)

九七的博客 2030

Python函数setdefault()

描述:Python 字典 setdefault() 函数和get() 方法类似, 如果键不存在于字典中,将会添加键并将值设为默认值。注意:setdefault() 返回的键如果不在字典中,会添加键(更新字典)语法:dict.setdefault(key,default = None)参数key - 这是要搜索的键。default - 这是在没有找到键的情况下则返回此值。返回值此方法返回字典中可用的...

丹青慕怀的博客 5962

【制作100个unity游戏之30】使用unity实现一款2d俯视角RPG战斗游戏,主要使用InputSystem+有限状态机+A*寻路实现(完结,附带项目源码)

【制作100个unity游戏之30】使用unity实现一款2d俯视角RPG战斗游戏,主要使用InputSystem+有限状态机+A*寻路实现

向宇的博客,专注php/web全栈 unity游戏开发,欢迎大家评论纠错 4651

2.Vivado软件基础操作

在本章节,我们以一个简单的计数器实例,介绍FPGA开发软件Vivado的基础操作流程,计数器实例程序的设计,在本课程中先不同掌握,后续课程将针对verilog编程进行讲解。 打开Vivado软件,会看到如下的界面: 点击如下图所示的: 点击Next> 将这个地方,设置路径,注意路径必须是英文路径。且文件夹名称第一个字符不能为数字。所有路径的名称的字符数量不能超过144个符号。 点击Next> 点击Next> 点...

FPGA/MATLAB学习教程/源码/项目合作开发 4477

Android UI学习 - Tab的学习和使用

本文是参考Android官方提供的sample里面的ApiDemos的学习总结。 TabActivity 首先Android里面有个名为TabActivity来给我们方便使用。其中有以下可以关注的函数: public TabHost getTabHost () 获得当前TabActivity的TabHost public TabWidget ...

weixin_34278190的博客 252

Claude Code 100个真实案例 - 用AI设计Arduino PCB电路板(硬件小白也能画板)

本案例展示如何使用 Claude Code 配合 KiCad 的 Python 脚本接口,从零设计一块 Arduino 传感器扩展板 PCB。从原理图符号创建、网表生成到 PCB 布局布线,全程自动化完成,最终输出可直接发给工厂打样的 Gerber 文件。

yueyeguzhuo的专栏 438

Android的Tab与TabHost讲解

在Android应用中,经常会用到TabHost选项卡,可以方便地在不同页面间切换。之前看过网上的一些教程,但大多都是一个形式,看得迷迷糊糊,不能让人很好的理解和学习。所以,在此详细地列出了Tab与TabHost的使用方法,有不妥之处,尽请指正!   首先,创建一个选项卡界面,需要使用一个TabHost和TabWidget。这个TabHost必须是根节点的布局,也就是main.xml。其中同时包

极致的专注 无限的热情 5616

OpenClaw零基础教程:30分钟搭建你的第一个AI自动化助手

别再看那些满是代码、专业术语的教程了,那些都是给程序员看的。这篇教程,我把所有步骤拆到了极致,你跟着点鼠标就行,点错了都没关系,大不了重装一遍,5分钟的事。

2601_94871597的博客 96

华为OD机考双机位C卷 - 池化资源共享 (Java & Python& JS & C/C++ & GO )

华为OD机考双机位C卷 - 池化资源共享 (OD上机考试双机位C卷)。提供Java、C++、Python、Go、JavaScript源码实现,并提供完整思路讲解,以及在线OJ模拟做题。

算法大师! 1070

Android UI学习 - Tab的学习和使用(转)

本文是参考Android官方提供的sample里面的ApiDemos的学习总结。 TabActivity 首先Android里面有个名为TabActivity来给我们方便使用。其中有以下可以关注的函数: public TabHost getTabHost ()获得当前TabActivity的TabHost public TabWidget getTabWidget ()获得...

SharkArmy 55

Vue3 - Element Plus 日期选择器 el-date-picker,设置 type=week 变成周选择器后,将选择周时修改为 “周一至周日“ 为一组范围(详细示例代码,新手小白秒会)

vue3,element-plus,DatePicker日期选择器,el-date-picker,周,type=week,周选择器,日期选择器week怎么拿到具体的时间范围,如何取week周选择器的value值,format如何设置,时间选择器按周选择时展示具体日期范围,vue3elementPlus日期选择器选择一周7天的数据格式怎么拿到,el-date-picker设置type等于week后怎么设置format属性,format和value-format怎么设置,范围选择器周,一周,选择一周7天时间

🏆 前端领域优质创作者 1万+

转-Android UI学习 - Tab的学习和使用

转载自http://android.blog.51cto.com/268543/315208 本文是参考Android官方提供的sample里面的ApiDemos的学习总结。 TabActivity 首先Android里面有个名为TabActivity来给我们方便使用。其中有以下可以关注的函数: public TabHost getTabHost ...

weixin_34413357的博客 101

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

Android UI学习 - Tab的学习和使用【转】

本文是参考Android官方提供的sample里面的ApiDemos的学习总结。 TabActivity 首先Android里面有个名为TabActivity来给我们方便使用。其中有以下可以关注的函数: public TabHost getTabHost () 获得当前TabActivity的TabHost public TabWidget getTabWidget () ...

weixin_33980459的博客 100

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

(转) Android UI学习 - Tab的学习和使用

TabActivity 首先Android里面有个名为TabActivity来给我们方便使用。其中有以下可以关注的函数: public TabHost getTabHost () 获得当前TabActivity的TabHost public TabWidget getTabWidget () 获得当前TabActivity的TabWidget public void...

weixin_34273479的博客 88

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

android自定义底部Tab,项目整体界面框架,安卓ndk开发书籍

android:singleLine=“true”android:tag=“personal”android:text=“@string/text_tab_profile”android:textColor=“@color/text_service_color”android:textSize=“14dp” />

时间与思念 1088

Android-Compose-Tab

SnakeTab - 一个高度灵活与定制性的ComposeTab效果图开源地址:功能介绍:SnakeRowTab:SnakeRowTab:关于构造函数的解释使用示例: 最近研究且学习Compose,目的是能够用Compose进行商业项目开发,过程中发现了Compose官方提供的Tab 为TabRow和ScrollTabRow,使用后感觉效果不错,但是定制性太差,完全无法用到项目中去,因此自己造轮子 效果图 有水印,将就着看一下吧… 开源地址: SnakeTab 我的项目开源在Gitee,且代码量非常小,

LZ511321的博客 2621

UI素材|标签页 Tab实用案例,可临摹学习

在导航类中有一种很基础也很重要的模块:tab选项卡与分段控件。它们功能一致,分别来自于安卓和苹果。其物理原型为书本上的小标签: 标签页 Tab 用于让用户在不同的视图中进行切换;标签数量,一般 2-4 个;其中,标签中的文案需要精简,一般 2-4 个字。 tab选项卡 Tab选项卡(tabs)是安卓系统中用来在不同页面或不同数据组之间切换的模块,这些页面或数据组分别用tab选项卡中的一个标签项(tab item)来表示,它们所代表的内容是属于同一层级、相互独立的的--没有顺序关系或比较关系,所以

awayaya1的博客 1297
上一篇: [转]CPM,CPC,CPA,CPS,哪一种适合你?
下一篇: [生活] 最近的状态 很不好 需要改变些了 更积极点
iPoolo
博客等级 码龄17年 2粉丝 168原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值