【问题标题】:How to create custome tab view like below如何创建自定义选项卡视图,如下所示
【发布时间】:2015-05-11 03:47:37
【问题描述】:

在发布我的问题之前浏览了许多网站。请帮忙。我目前正在研究企业应用程序。我想用所有新的 UI 来设计我的应用程序。我的应用程序需要一些选项卡视图来显示不同类型的发票。我希望标签视图与下面显示的屏幕截图完全相同。当然,这是一个 ios 屏幕截图,但我想要在 android 中。提前致谢。

【问题讨论】:

  • 你有没有尝试过?实施起来并不难。至少从你的角度尝试一些东西!

标签: android tabview


【解决方案1】:

您可以自定义。 https://github.com/JakeWharton/ViewPagerIndicator

 //Set the pager with an adapter
 ViewPager pager = (ViewPager)findViewById(R.id.pager);
 pager.setAdapter(new TestAdapter(getSupportFragmentManager()));

 //Bind the title indicator to the adapter
 TitlePageIndicator titleIndicator = (TitlePageIndicator)findViewById(R.id.titles);
 titleIndicator.setViewPager(pager);

使用,查看寻呼机调用片段详细信息。

【讨论】:

    【解决方案2】:

    ViewPager 寻呼机 = (ViewPager)findViewById(R.id.pager); pager.setAdapter(new TestAdapter(getSupportFragmentManager()));

    对选项卡使用自定义布局,并在页面 changeListner 上设置布局背景。 (为此也可以使用 Selector)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多